Error: Code blocks are not supported in this context
Stack Trace: at System.Web.UI.ControlBuilder.AppendSubBuilder(ControlBuilder subBuilder) at System.Web.UI.TemplateParser.AppendSubBuilder(ControlBuilder builder, ControlBuilder subBuilder) at System.Web.UI.TemplateParser.ProcessCodeBlock(Match match, CodeBlockType blockType, String text) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
Cause of Error:
This error occurs mainly if your .aspx page, html tags are not closed properly or you have Bad Html tags which could lead to Html Parser error.
Example: I was playing with FreeTextBox, in Html mode. Suddenly a Phone rangup and forget to close Html tag inside FreeTextbox.
<FTB:FreeTextBox ID="FreeTextBox1" runat="Server"
Width="700" Height="500" TabIndex="8" DisableIEBackButton="true">
<Toolbars>
<FTB:Toolbar>
<FTB:InsertHtmlMenu runat="server" Title="Insert Code">
<Items>
<FTB:ToolbarListItem Text="Student" Value="<img
src='<%= Page.ResolveUrl("~")%>Images/add_buddy.gif' />"
runat="server" />
</Items>
</FTB:InsertHtmlMenu>
</FTB:Toolbar>
</Toolbars>
</FTB:FreeTextBox>
Solution:
Remove Bad Html or rectify Bad Html part from your .aspx page and this error would get resolved.
No comments:
Post a Comment