Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The server tag is not well formed.

Status
Not open for further replies.

jwrz200t

Programmer
Aug 1, 2006
19
US
I want to sort a date column in a grid view and iam using the following code. Iam getting an error The server tag is not well formed.

<asp:TemplateField HeaderText ="Date Injured">
<EditItemTemplate>
<asp:Label ID="Label3" runat="server" Text=‘<%# Eval("DATE", "{0:MM/dd/yyyy}") %>‘></asp:Label>
</EditItemTemplate>
<Itemtemplate>
<asp:Label ID="Label3" runat="server" Text=’<%# Bind(“DATE”, “{0:MM/dd/yyyy}”) %>‘> </asp:Label>
</itemtemplate>
</asp:TemplateField>
 
Error 1 C:\Inetpub\ ASP.NET runtime error: A call to Bind must be assigned to a property of a control inside a template. C:\Inetpub\ 88. This error is occouring at line 88 which is <asp:Label ID="Label3" runat="server" Text=’<%# Bind(“DATE”, “{0:MM/dd/yyyy}”) %>‘> </asp:Label>
and also its bringing up another error

Error 2 The server tag is not well formed. C:\Inetpub\ 85 . Line 85 is <asp:Label ID="Label3" runat="server" Text=‘<%# Eval("DATE", "{0:MM/dd/yyyy}") %>‘></asp:Label>
 
<%# Convert.ToDateTime(Eval("DATE")).ToString("MM/dd/yyyy")%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top