2012-12-12 54 views
0

我正在使用SharePoint中的小應用程序。我有一個我正在加載的自定義應用程序頁面.ascx控制在Page_Load()方法下。 .ascx控件是一個帶有文本框和按鈕的小型窗體。現在,當我點擊鏈接,信息保存成功在SharePoint中的列表,但它提供了運行時錯誤:想要在按鈕單擊事件後保持同一頁面

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.

Details: To enable the details of this specific error message to be viewable on the local server machine, please create a customErrors tag within a "web.config" configuration file located in the root directory of the current web application. This customErrors tag should then have its "mode" attribute set to "RemoteOnly". To enable the details to be viewable on remote machines, please set "mode" to "Off".

我檢查我的web.config和customError代碼的確存在且模式設置爲「關」。

什麼是問題?我想在點擊按鈕後保持在同一頁面上。

回答

0

它絕對停留在同一頁面上,因爲asp.net頁面始終只回發給自己,並且只有在您明確要求回覆時纔會重定向。你的代碼或web.config文件中有一些錯誤。

而且錯誤是在回傳碼 即某處頁面上的塊有像

if (isPostBack) 
{ 
    **//Some code with error** 
} 

一些代碼,因爲只有當你回來後出現錯誤。

我建議你去一步一步的調試,並指出錯誤的確切路線。

0

通過使用Response.Redirect(Request.RawUrl);解決了上述問題。

相關問題