By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,140 Members | 1,455 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,140 IT Pros & Developers. It's quick & easy.

the server tag is not wel formed for a label which is inside a datalist

P: 2
I am encountering the an error that is telling me that the server tag is not well formed for a label which is inside a DataList.

This is that part of that program having that error:
Expand|Select|Wrap|Line Numbers
  1. <asp:DataList ID="DataList1" runat="server" DataSourceID="XmlDataSource1" 
  2.         RepeatColumns="1" style="margin-right: 0px">
  3.         <ItemStyle Font-Bold="True" Font-Italic="True" Font-Names="Times New Roman" 
  4.             Font-Overline="False" Font-Size="Medium" Font-Strikeout="False" 
  5.             Font-Underline="False" HorizontalAlign="Justify" VerticalAlign="Bottom" />
  6.             <ItemTemplate>
  7.             <a href="#" class="mySprite id<%# ((int)DataBinder.Eval(Container,"ItemIndex")) % 6 + 1%>">  
  8.               <asp:Label ID="Label5" runat="server" Text="<%# Name %>"></asp:Label>
  9.                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  10.                 <asp:TextBox ID="TextBox8" runat="server" Text="<%# XPath("Name") %>"></asp:TextBox>
  11.                 <br />
  12.                 <asp:Label ID="Label6" runat="server" Text="<%# City %>"></asp:Label>
  13.                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  14.                 <asp:TextBox ID="TextBox9" runat="server" Text="<%# XPath("City") %>"></asp:TextBox>
  15.                 <br />
  16.                 <asp:Label ID="Label7" runat="server" Text="<%# Age %>"></asp:Label>
  17.                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  18.                 <asp:TextBox ID="TextBox6" runat="server" Text="<%# XPath("Age") %>"></asp:TextBox>
  19.                 <br />
  20.                 &nbsp;&nbsp;&nbsp;
  21.                 <br />
  22.                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  23.             </ItemTemplate>
  24.     </asp:DataList>
Mar 20 '12 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 9,731
It's because of your Eval code.
Instead of using double quotes (") for class="...", try using single quotes class = ' ....'. Same thing for your Text="" and anywhere else that you have Eval code.
Mar 20 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.