{"id":2917,"date":"2014-03-10T12:35:32","date_gmt":"2014-03-10T12:35:32","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/10\/javascript-error-after-using-script-manager-the-message-received-from-the-server-could-not-be-parsed-collection-of-common-programming-errors\/"},"modified":"2014-03-10T12:35:32","modified_gmt":"2014-03-10T12:35:32","slug":"javascript-error-after-using-script-manager-the-message-received-from-the-server-could-not-be-parsed-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/10\/javascript-error-after-using-script-manager-the-message-received-from-the-server-could-not-be-parsed-collection-of-common-programming-errors\/","title":{"rendered":"Javascript Error after using Script Manager- : The message received from the server could not be parsed-Collection of common programming errors"},"content":{"rendered":"<p>I am opening a ShowModalDialog on a button OnClientClick event and the javascript for it is:-<\/p>\n<pre> function openmodalWinLunch() { var variable1 = \"Lunch\"; window.showModalDialog(\"ClockPopUP.aspx?code=\" + variable1, \"dialogWidth:290px;dialogHeight:270px,\"); }\n<\/pre>\n<p>On the Clock.aspx page i have a asp button on which i had written code :-<\/p>\n<pre>protected void btnStop_Click(object sender, EventArgs e) { _nonProduction = new NonProduction(); if (Session[\"LastNonProdTimeID\"] == null) { } else { int NonProdTimeEntryID = Convert.ToInt32(Session[\"LastNonProdTimeID\"]); isTimeSpentUpdated = _nonProduction.UpdateTimeSpentInDB(NonProdTimeEntryID); if (isTimeSpentUpdated == true) {\n  string timespent = Convert.ToString(_nonProduction.GetTimeSpent(NonProdTimeEntryID)); Response.Write(\"window.close();\"); Response.End();\n  } else\n            {\n            }\n        }\n    }<\/pre>\n<p>Previously every thing is working fine and this code is working as per my requirement. Just i had added Scriptmanager on the Clock.aspx as i m showing a clock which shows the elapsed time to the user. After that when i m clicking on the btn_Stop on CLock.aspx page i am getting this error message:-&#8220;Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.&#8221; \u00a0 Please guide me that how i solve this issue. \u00a0<\/p>\n<p>I found that what is the root cause of this error. It is happening because i m using Resonse.Write and other information is Here<\/p>\n<p>\u00a0<\/p>\n<p>Guide me that how i fix this as i want to close the webpage after button click event.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am opening a ShowModalDialog on a button OnClientClick event and the javascript for it is:- function openmodalWinLunch() { var variable1 = &#8220;Lunch&#8221;; window.showModalDialog(&#8220;ClockPopUP.aspx?code=&#8221; + variable1, &#8220;dialogWidth:290px;dialogHeight:270px,&#8221;); } On the Clock.aspx page i have a asp button on which i had written code :- protected void btnStop_Click(object sender, EventArgs e) { _nonProduction = new NonProduction(); [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2917","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2917","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2917"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2917\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2917"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2917"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2917"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}