[英]Server.Transfer does not work?
我想使用Server.Transfer重定向到另一個頁面,我有以下簡單代碼:
if (Page.IsPostBack)
{
try
{
Server.Transfer("AnotherPage.aspx");
}
catch (Exception)
{
throw ;
}
}
但是我收到一個錯誤:“對AnotherPage.aspx執行子請求時出錯。”。 在網上找不到解決方案。
只需提及,Response.Redirect即可正常工作。
該錯誤很可能是由於AnotherPage.aspx中的某些內容引起的。 您可能要在AnotherPage.aspx的Load事件中插入try... catch
處理程序。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.