Telerik blogs

How many times you get this in your ASP.NET AJAX 1.0 applications?

After several support tickets we manage to isolate this to very simple case - standard UpdatePanel and a Button writing in Session. How weird?

Here is the code:

 

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Page.Session("test") = "test"
    End Sub
</script>

<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:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:Button ID="Button1" Text="Button1" runat="server" OnClick="Button1_Click" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>

 

To reproduce this every time you can simply change something in the web.config file - single space will do the trick.

Now run the application and you will get famous "Sys.WebForms.PageRequestManagerParserErrorException":

Untitled

 

So what now?

Well the resolution is even more weird... just add a Global.asax file to your application and you are ready to go!

Weird, isn't it?


About the Author

Vladimir Enchev

is Director of Engineering, Native Mobile UI & Frameworks

Comments

Comments are disabled in preview mode.