Sys.WebForms.PageRequestManagerParserErrorException

  • 8350
  • 0

摘要:Sys.WebForms.PageRequestManagerParserErrorException

好長的錯誤提示!

The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Writ(),response filters HttpModules,or server trace is enabled.

Details:Error parsing near '<script language='J'.

這麼長的信息原來是說....使用了…功能造成無法分析?!

以下轉載自Huan-Lin 學習筆記

朋友問:「為什麼程式加了 ScriptManager 和 UpdatePanel 之後,原本沒問題的程式,卻出現 Sys.WebForms.PageRequestManagerParserErrorException?」

Eilon Lipton 有篇文章提供了很詳細的說明,包括該錯誤的意義、發生原因、以及解決方法:Sys.WebForms.PageRequestManagerParserErrorException - what it is and how to avoid it

常見的原因包括:
  • 在程式中呼叫 Response.Write 輸出資料至用戶端頁面。這會導致 UpdatePanel 無法對這些資料編碼。
     
  • 網站有使用 response filter。
  • 網站有使用 HTTP modules。
  • 開啟網頁的 trace 功能。
  • 在程式中呼叫 Server.Transfer。
     
那位朋友碰到的情況,是程式中使用 Server.Transfer 的方式轉址。改成 Response.Redirect 就解決了。
 

 

我的問題是在於Response.Write,拿出來放就好了 = ="

一個蔔蔔一個坑!