I am using the MvcApplicationSample and in index.aspx page I have added following simple code:
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="PostBack" OnClick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="updatePanel" DisplayAfter="1">
<ProgressTemplate>Loading ...</ProgressTemplate>
</asp:UpdateProgress> And the Button1_Click code is below:
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(TempData["count"].ToString());
}When I run the application and click on the button, I am getting the following error: "Microsoft JScript 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 '|4|formAction||Home|'." Do it mean we can not use Response.Write() when we are using <asp:ScriptManager> and <asp:UpdatePanel> or I am doing any mistake?