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 EnvironmentCould 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>
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.