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

昨天,朋友的程序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使用下面方法远程协助帮他把问题解决,解决方法如下:

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

 

转载于:https://www.cnblogs.com/insus/archive/2011/09/10/2173051.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值