簡體   English   中英

Server.Transfer不起作用?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM