https://www.codeproject.com/Questions/56736/How-to-use-Server-Transfer-from-Ajax-UpdatePanel

For Server.Transfer to work with UpdatePanel.

for getting update panel to post back.
we need to register post back contorl with the scriptmanager.

ScriptManager1.RegisterPostBackControl(button1);

and in this control you can do server.transfer.

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。


btnAction这个按钮点击之后,后台有异常,触发了OnError事件。
OnError事件中有Server.Transfer的代码。

需要使用script manager注册一下btnAction

   var scriptManager = ScriptManager.GetCurrent(Page);
                scriptManager?.RegisterPostBackControl(btnAction);

 

调试技巧:

直接在源码中切换到target 页面,在page_load中加断点。看是否已经进入了target页面。

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄