继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

在Ajax1.0中使用Response.Redirect()

安卓入门学习视频
关注TA
已关注
手记 267
粉丝 68
获赞 387

昨天,朋友的程序asp.net2.0想使用Ajax1.x版本。其中有一个button,需要做页面转跳Response.Redirect(),当一点击按钮时,发生不想看到的异常:

sys.WebForms,PageRequestManagerParsesErrorExceptio n: The message received from the server could be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

Details: Error parsing near ‘ </div>

|<html>
<head>
‘ .

朋友来电说,他想使用Insus.NET一个组件:http://www.cnblogs.com/insus/articles/1341703.html 来解决。

obj.jsAlert("","this","Default.aspx"); 这样写的话,会有一个无字窗口,点击确认之后,才转跳,就不会出现上面的异常。

因此要求Insus.NET是否可以更改这个DLL,加多一个方法重载,作为可以直接转跳页面的功能。

 

由于这个算不上Javascript方面的问题,Insus.NET想不必去改这个DLL。因此Insus.NET使用下面方法远程协助帮他把问题解决,解决方法如下:

5acf07360001405b00110016.jpgView Code  protected void Button1_Click(object sender, EventArgs e)
    {
       // Response.Redirect("~/Default.aspx");
        
        Button button = (Button)sender;
        button.PostBackUrl = "~/Default.aspx";
    }

 

打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP