Ampersand in Title Tag Throws Atlas Unknown Error
I ran into a strange problem today working with the July CTP (it probably in earlier CTPs as well).
I had a fairly simple Atlas page that uses update panels. The page would continually throw an "Unknown
Error" alert box when the update panel is being updated. Curiously, the cause of the error turns out not to be
due to the Atlas UpdatePanel controls I had on the page but because I had an ampersand (&) in the title tag.
Changing the "&" sign to an "and" fixed it.
Here's a simplified repro of the bug.
<%@ 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)
{
Label1.Text = string.Format("Hello {0}, the time is {1}.", TextBox1.Text, DateTime.Now.ToLongTimeString());
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Copy & Paste</title>
</head>
<body>
<form id="form1" runat="server">
<atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering=true />
<atlas:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Submit" OnClick="Button1_Click" /><br />
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
</ContentTemplate>
</atlas:UpdatePanel>
</form>
</body>
</html>
A quick search of the Atlas forums revealed that others already have ran into this problem before and the issue is more generic to special
characters in the title tag. In addition to this bug, forum members Gavin and Luis Abreu have compiled an unofficial list of Atlas bugs as reported in the Atlas Forums.
It's a good idea to go through this list to get a general feel about the reported bugs by Atlas forum members and
things to avoid in the Atlas CTP until they are fixed. Since these releases are Community Tech Previews, it's understandable that there are bugs in the framework.
Update:
Hannes Preishuber suggests setting
ValidateRequest="false" in the page directive as a solution.