Whidbey ASP.NET Literal control bug
For some reason, the ASP.NET Literal control doesn't like calls to server side scripts or Eval statements. Any call to a server side script fails with the following parse time message: 'System.Web.UI.WebControls.Literal' does not allow child controls.
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">
public string CallMe()
{
return ("hi there");
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<% CallMe();%>
<asp:Literal Runat=Server>
<% CallMe();%>
</asp:Literal>
</form>
</body>
</html>
Please vote on this bug:
http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackId=fe629cb4-9345-47fe-8073-817eb9351cc8