W
Wayne Wengert
I am trying to modify the output of a repeater control based on values in
the source database. If I simply want to display the contents of a specific
field I use a syntax such as:
<td><%# Container.DataItem("Author") %></td>
This works fine but when I want to use a bound value in program logic I get
"Expression Expected" and/or other errors. I am trying code similar to the
following:
<%
If (<%#Container.DataItem("StartDate")%> > lastdate) then
lastdate = <%#Container.DataItem("StartDate") %>
Response.Write("<tr><td colspan='4'><h3>" & lastdate &
"</h3></td></tr>")
End If
Dim strTemp As String
strTemp = <%#Container.DataItem("StartDate")%>.ToString( "d" )
Response.Write("<td>" & strTemp & "</td>")
%>
I've tried eliminating the <% and %> in the binding tag since it is already
within a code block but that also fails.
What is the correct way to code this?
Wayne
the source database. If I simply want to display the contents of a specific
field I use a syntax such as:
<td><%# Container.DataItem("Author") %></td>
This works fine but when I want to use a bound value in program logic I get
"Expression Expected" and/or other errors. I am trying code similar to the
following:
<%
If (<%#Container.DataItem("StartDate")%> > lastdate) then
lastdate = <%#Container.DataItem("StartDate") %>
Response.Write("<tr><td colspan='4'><h3>" & lastdate &
"</h3></td></tr>")
End If
Dim strTemp As String
strTemp = <%#Container.DataItem("StartDate")%>.ToString( "d" )
Response.Write("<td>" & strTemp & "</td>")
%>
I've tried eliminating the <% and %> in the binding tag since it is already
within a code block but that also fails.
What is the correct way to code this?
Wayne