473,396 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
1 2032
Frinavale
9,735 Expert Mod 8TB
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

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

Similar topics

3
by: Dude | last post by:
Below is the code - it is finding the control, and there is no error, just not assigning the text to the label <asp:DataList id="dlGoals" runat="server" onEditCommand="myListEditHandler"...
1
by: Kristoffer Arfvidson | last post by:
<asp:DataGrid id="DataGrid1" runat="server" AllowPaging="True" AutoGenerateColumns="False" Font-Names="Verdana, Arial, Helvetica, sans-serif" AllowCustomPaging="True" GridLines="Horizontal">...
3
by: Srini | last post by:
I have a server side label and text box From the client side I am changing the value of the ASP.NET labe using the innerText property of the label. When I try to access the label from the server...
4
by: V. Jenks | last post by:
What seems like a simple thing is apparently not so straightforward? I have a datalist. Inside of that datalist is an <itemtemplate> secion which contains other server controls such as a...
1
by: Bigtoga | last post by:
Okay - I'm going crazy here trying to figure out how to do this - here goes: I have a DataList populated by a DataReader. In the DataReader, a column is present called "IsInCategory". I want to...
4
by: John Lau | last post by:
Hello, In Asp, you can render a server side variable inside the quotes in an html element attribute. For example: <link rel="stylesheet" href="<%=SomeVariableName%>" type="text/css"> I'm...
3
by: Danny Tuppeny | last post by:
Hi all, I've got a DataList that's bound to a datasource with two columns (well, two that matter). One is called GigDate, and one is called RescheduledFromDate. GigDate doesn't allow NULLs,...
1
by: Miguel Dias Moura | last post by:
Hello, I have a GridView in my page with a TemplateField and an Asp Label inside it. I need to access that Label in runtime and change the field to which it is binded. Can someone please...
2
by: Michael | last post by:
Question. Is it possible to run Server.execute command inside global.asa file. if it is where. Inside Application onstart? Another ideas appreciated. Michael
0
by: Giorgio | last post by:
Hi, I've an accordion inside a Datalist, i've bind the datalist with my objectdatasource and i want inside the Accordion to access the datasource, like : <cc1:AccordionPane...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.