Expression Expected Error

W

Wayne Wengert

I am trying to build an aspx page with a repeater contol bound to a
sqldatareader. I can get the basic fields to display just fine but I want to
format a date/time filed. My code is below. I am getting "Expression
Expected" on the line where I am trying to build a formatted date string.

What did I miss here?

Wayne


======================================
<asp:Repeater id="Repeater1" runat="server">
<ItemTemplate>
<tr>
<%
Dim strTemp As String
strTemp = #Container.DataItem("StartDate").ToString( "d" ) <==
Error occurs here
Response.Write("<td>" & strTemp & "</td>")
%>
<td><%# Container.DataItem("RegionalID") %> </td>
<td><%# Container.DataItem("Location") %> </td>
<td align="center"> <%# Container.DataItem("NbrOfDays") %> </td>
</tr>

</ItemTemplate>
</asp:Repeater>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top