JavaScript error "Uncaught TypeError: Cannot read property 'PRM_ParserErrorDetails' of undefined"
MicrosoftAjaxWebForms.js:6 Uncaught TypeError: Cannot read property 'PRM_ParserErrorDetails' of undefined at Sys.WebForms.PageRequestManager._parseDelta
(MicrosoftAjaxWebForms.js:6) at Sys.WebForms.PageRequestManager._onFormSubmitCompleted (MicrosoftAjaxWebForms.js:6) at Array.<anonymous>
(MicrosoftAjax.js:6) at MicrosoftAjax.js:6 at Sys.Net.WebRequest.completed (MicrosoftAjax.js:6) at XMLHttpRequest._onReadyStateChange
(MicrosoftAjax.js:6)
之前工作時出現這個錯誤,不知道原因為何,上網查詢了一下之後發現,貌似是因為JavaScript沒有註冊
他是一個寫在呼叫自定義的Table內的按鈕 接著是用後端寫入的按鈕,因此當初沒有加入這一條
ScriptManager.GetCurrent(Page).RegisterPostBackControl(but);
多了這段之後就可以正常運行了
Also had this problem with my .ascx user control (ASP.NET Web Pages project).
- Make sure you do this first
- In my case, I was missing a PostBackTrigger on my control:
<asp:PostBackTrigger ControlID="yourControl" />
判斷原因可能是因為把button 寫在後端? 導致按下的時候沒有postback?
不過這個參考網站寫的是他沒有新增至信任網站,但是當初解除這麼error的時候是用上面的解法。
參考:
https://social.msdn.microsoft.com/Forums/en-US/839e8abf-53b5-42d2-b804-9e3a71172ad1/uncaught-typeerror-cannot-read-property-prmparsererrordetails-of-undefined
https://stackoverflow.com/questions/42568296/uncaught-typeerror-cannot-read-property-prm-servererror-of-undefined
留言
張貼留言