Even for small progrm using update panel also causing error. I am getting the following error.
Unhandled exception at line 6, column 16485 in http://localhost:1809/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js
0x800a139e - JavaScript runtime error: 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.Write(), response
filters, HttpModules, or server trace is enabled.
Details: Error parsing near '
<!DOCTYPE html> '.
Can anybody please suggest me where I am doing wrong? Or do I need to do any setting?
It is not a good practice to use Response.Write or server.execute from within an ASP.NET page in general. As UpdatePanels work by intercepting the page rendering process you are recieving the errors.
You can put the code to generate the data in an HTTPHandler or you can make the button a PostBackTrigger.
Because of the way updatepanels manage the DOM elements within them, you cannot use Response.Write() with them.
Hi chetan.sarode,
Thank you for your reply and sorry for the late response. My system was crashed and I could not concentrate on this work for last two days.
I have taken first link from your answer as a base and I have modified my program accordingly. i.e. I have replaced the static text in .aspx file with Lable Text. Even then, I am gettting the same problem.
This is the whole lot of code I have written. I am getting the above error which caused this post. Can you please check and let me know where I am doing wrong?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
namespace CSHWEB
{
public partial class UpdatePanelWithUpdateProgress : System.Web.UI.Page
{
SqlConnection objConn = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
SqlCommand objCmd = new SqlCommand("usp_GetEmployeesAll", objConn);
objCmd.CommandType = System.Data.CommandType.StoredProcedure;
objConn.Open();
System.Threading.Thread.Sleep(4000);
GridView1.DataSource = objCmd.ExecuteReader();
GridView1.DataBind();
objConn.Close();
}
}
}
I did not reproduce the error your descriped with your code. It seems you are facing issue when using UpdateProgress control. I would like to suggest you check the following example in MSDN.
I did not get much expertise on VS-2012 or Windows-8 yet. But, I found with the help of google that the above error is coming in IE browser alone, but not in other browsers.
Hence, I am advancing my work with the help of other browsers.
Thank you for each and everyone who have tried on my problem.
Regards,
Ashok kumar.
Ashok kumar
Marked as answer by kak.mca on Jan 27, 2013 11:33 AM
kak.mca
Member
66 Points
158 Posts
I could not able to make update panel work in VS-2012 Final Version. Where I am doing wrong?
Jan 20, 2013 05:48 AM|LINK
Hi,
Even for small progrm using update panel also causing error. I am getting the following error.
Unhandled exception at line 6, column 16485 in http://localhost:1809/Scripts/WebForms/MsAjax/MicrosoftAjaxWebForms.js
0x800a139e - JavaScript runtime error: 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.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '
<!DOCTYPE html>
'.
Can anybody please suggest me where I am doing wrong? Or do I need to do any setting?
Thanks in advance...
chetan.sarod...
All-Star
65729 Points
11138 Posts
Re: I could not able to make update panel work in VS-2012 Final Version. Where I am doing wrong?
Jan 21, 2013 02:29 AM|LINK
Hi
It is not a good practice to use Response.Write or server.execute from within an ASP.NET page in general. As UpdatePanels work by intercepting the page rendering process you are recieving the errors.
You can put the code to generate the data in an HTTPHandler or you can make the button a PostBackTrigger.
Because of the way updatepanels manage the DOM elements within them, you cannot use Response.Write() with them.
http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx
http://vijaymodi.wordpress.com/2007/04/13/syswebformspagerequestmanagerparsererrorexception/
http://forums.asp.net/t/1038252.aspx
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
kak.mca
Member
66 Points
158 Posts
Re: I could not able to make update panel work in VS-2012 Final Version. Where I am doing wrong?
Jan 24, 2013 01:36 AM|LINK
Hi chetan.sarode,
Thank you for your reply and sorry for the late response. My system was crashed and I could not concentrate on this work for last two days.
I have taken first link from your answer as a base and I have modified my program accordingly. i.e. I have replaced the static text in .aspx file with Lable Text. Even then, I am gettting the same problem.
This is the whole lot of code I have written. I am getting the above error which caused this post. Can you please check and let me know where I am doing wrong?
.aspx page
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UpdatePanelWithUpdateProgress.aspx.cs" Inherits="CSHWEB.UpdatePanelWithUpdateProgress" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="2"> <ProgressTemplate> <asp:Label ID="Label1" runat="server" Text="Contacting server..."></asp:Label> <span id="messageSpan"></span> </ProgressTemplate> </asp:UpdateProgress> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:GridView ID="GridView1" runat="server"> </asp:GridView> <asp:Button ID="Button1" runat="server" Text="Refresh" /> </ContentTemplate> </asp:UpdatePanel> </div> </form> </body> </html>Code behind
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; namespace CSHWEB { public partial class UpdatePanelWithUpdateProgress : System.Web.UI.Page { SqlConnection objConn = new SqlConnection(System.Web.Configuration.WebConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString); protected void Page_Load(object sender, EventArgs e) { SqlCommand objCmd = new SqlCommand("usp_GetEmployeesAll", objConn); objCmd.CommandType = System.Data.CommandType.StoredProcedure; objConn.Open(); System.Threading.Thread.Sleep(4000); GridView1.DataSource = objCmd.ExecuteReader(); GridView1.DataBind(); objConn.Close(); } } }Thanks in advance...
Yanping Wang...
Star
14871 Points
1529 Posts
Microsoft
Re: I could not able to make update panel work in VS-2012 Final Version. Where I am doing wrong?
Jan 25, 2013 07:31 AM|LINK
Hi kak.mca,
I did not reproduce the error your descriped with your code. It seems you are facing issue when using UpdateProgress control. I would like to suggest you check the following example in MSDN.
<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void Button1_Click(object sender, EventArgs e) { // Introducing delay for demonstration. System.Threading.Thread.Sleep(3000); Label1.Text = "Page refreshed at " + DateTime.Now.ToString(); } </script> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"> <title>UpdateProgress Tutorial</title> <style type="text/css"> #UpdatePanel1 { width:300px; height:100px; } </style> </head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <fieldset> <legend>UpdatePanel</legend> <asp:Label ID="Label1" runat="server" Text="Initial page rendered."></asp:Label><br /> <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> </fieldset> </ContentTemplate> </asp:UpdatePanel> <asp:UpdateProgress ID="UpdateProgress1" runat="server"> <ProgressTemplate> Processing... </ProgressTemplate> </asp:UpdateProgress> </div> </form> </body> </html>More info please refer http://msdn.microsoft.com/en-us/library/bb386421(v=vs.100).aspx
hope this helps, thanks.
Feedback to us
Develop and promote your apps in Windows Store
kak.mca
Member
66 Points
158 Posts
Re: I could not able to make update panel work in VS-2012 Final Version. Where I am doing wrong?
Jan 27, 2013 11:33 AM|LINK
Hi All,
I did not get much expertise on VS-2012 or Windows-8 yet. But, I found with the help of google that the above error is coming in IE browser alone, but not in other browsers.
Hence, I am advancing my work with the help of other browsers.
Thank you for each and everyone who have tried on my problem.
Regards,
Ashok kumar.