server.Transfer不工作

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.


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

需要使用script manager注册一下btnAction

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

猜你喜欢

转载自www.cnblogs.com/chucklu/p/10758124.html