Home
ASP.Net
SQL Server
Web designing
C# [C Sharp]
Errors and Solutions
Others
Submit Article
Rss Feed
Xml Site Map
Contact Me
QnA
About Me

ASP.net control error: Server tag not well formatted

View this article as Pdf document

Posted by amit verma on 06 Aug 2008 under Errors and Solutions category
Download as Pdf   

Introduction

I've been lately working on building a Test skill module for my web site and to show the option for a question I used a <asp:Repeater and inside that I'm using HTML checkbox control until checkbox didn't have runat attribute it worked fine but the moment I added runat It gave Server tag not well formatted error my code looks like as follows
<asp:Repeater runat="server">
<ItemTemplate>
<input type="checkbox" runat="server" id="op1" value="<% # Container.DataItem("option1") %>" />
</ItemTemplate>
</asp:Repeater>
The most probably is the problem raises before you are trying to view the page in the browser, when you want to switch between the HTML view and the Design view in the Visual Studio editor, the development environment show a message with the following text:
Microsoft Development Environment
Could not open in Design view. Quote values differently inside a '' block.
this gave me some hit and then i tried to remove the double quote from value attribue and use single quote and my code worked!. Working code looks something like this
<asp:Repeater runat="server">
<ItemTemplate>
<input type="checkbox" runat="server" id="op1" value='<% # Container.DataItem("option1") %>' />
</ItemTemplate>
</asp:Repeater>

<< Previous

Next >>

About the Author

I've been workin in microsoft technologies for more then 7 years and worked on Web and windows based application.I've been working on Clasic ASP,ASP.Net,C#,Javascript,HTML,SQL server and currently exploring C#3.5 and WFC.

Enter your name

Enter your email address

Enter your comments(upto 500 chars)

Type the characters you see in the picture below.

Word Verification