Hi Guys,
I am not sure if I am posting this in the correct forum but here goes.
I am really new to ASP.NET and I am trying very slowly to convert some existing ASP classic pages to .NET.
In a particular asp page I check for a value in a particular recordset field and then replace it with an image,shown below is the code i am using.
Is it possible to create something similar to this in asp.net, I have managed to create a gridview to display the data and this is what I have at the moment
Any help or suggestions would be most appreciated.
Regards
Paul
I am not sure if I am posting this in the correct forum but here goes.
I am really new to ASP.NET and I am trying very slowly to convert some existing ASP classic pages to .NET.
In a particular asp page I check for a value in a particular recordset field and then replace it with an image,shown below is the code i am using.
Code:
<%if (rsLateLoads.Fields.Item("StatusLight").Value)= "R" then%>
<img src="../Images/RedXSmall.png" width="10" height="10" />
<%elseif (rsLateLoads.Fields.Item("StatusLight").Value)= "G" then%>
<img src="../Images/GreenXSmall.png" width="10" height="10" />
<%elseif (rsLateLoads.Fields.Item("StatusLight").Value)= "ND" then%>
<img src="../Images/BlueXSmall.png" width="10" height="10" />
<%else%>
<img src="../Images/AmberXSmall.png" width="10" height="10" />
<%end if%>
Is it possible to create something similar to this in asp.net, I have managed to create a gridview to display the data and this is what I have at the moment
Code:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" style="float:left"
DataSourceID="DespLoads"
DataKeyNames="LoadID"
GridLines="None"
CssClass="mGrid"
AlternatingRowStyle-CssClass="alt" Width="550px">
<Columns>
<asp:CommandField HeaderText="Details" SelectText="Go"
ShowSelectButton="True" />
<asp:BoundField DataField="LoadID" HeaderText="LoadID"
SortExpression="LoadID" />
<asp:BoundField DataField="StatusDesc" HeaderText="Status"
SortExpression="StatusDesc" />
<asp:BoundField DataField="PlanShipDate" HeaderText="Plan ShipDate/Time"
SortExpression="PlanShipDate" />
<asp:BoundField DataField="StatusDateTime" HeaderText="Status Date/Time"
SortExpression="StatusDateTime" />
<asp:BoundField DataField="StatusLight" HeaderText="Flag"
SortExpression="StatusLight" />
</Columns>
<AlternatingRowStyle CssClass="alt" />
</asp:GridView>
Any help or suggestions would be most appreciated.
Regards
Paul