meltingpot
Technical User
My first go at .NET ..
Im building a datagrid to display fields in a database. One of the columsneeds to have this code running in it - not sure how to do it. The script works fine in classic ASP.
Example:Cut out from main script
<asp:TemplateColumn HeaderText="Warning"
Visible="True">
<ItemTemplate>
<%
Dim strBoat, iElapsed
strBoat = boats("HMSTC") & ""
iElapsed= DateDiff("h", boats("PositionDate"), now())
Response.Write "Boat" & vbCrLf
Response.Write "Days from last entry" & vbCrLf
Response.Write strBoat & vbCrLf
Response.Write iElapsed \24 & vbCrLf
Response.Write rsBoats("callsign") & vbCrLf
if iElapsed <= 24 then
'24 hours or less
Response.Write & "<img src='boat_okblk.gif'>" & vbCrLf
else
'More than 24 hours
Response.Write & "<img src='boat_lateblk.gif'>" & vbCrLf
end if
Boats.MoveNext
Loop
%>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="callsign"
HeaderText="callsign"
ReadOnly="true"
Visible="True"/> ... more
Im getting many errors - Im not sure that mixing versions work.
Help
Im building a datagrid to display fields in a database. One of the columsneeds to have this code running in it - not sure how to do it. The script works fine in classic ASP.
Example:Cut out from main script
<asp:TemplateColumn HeaderText="Warning"
Visible="True">
<ItemTemplate>
<%
Dim strBoat, iElapsed
strBoat = boats("HMSTC") & ""
iElapsed= DateDiff("h", boats("PositionDate"), now())
Response.Write "Boat" & vbCrLf
Response.Write "Days from last entry" & vbCrLf
Response.Write strBoat & vbCrLf
Response.Write iElapsed \24 & vbCrLf
Response.Write rsBoats("callsign") & vbCrLf
if iElapsed <= 24 then
'24 hours or less
Response.Write & "<img src='boat_okblk.gif'>" & vbCrLf
else
'More than 24 hours
Response.Write & "<img src='boat_lateblk.gif'>" & vbCrLf
end if
Boats.MoveNext
Loop
%>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn DataField="callsign"
HeaderText="callsign"
ReadOnly="true"
Visible="True"/> ... more
Im getting many errors - Im not sure that mixing versions work.
Help