A
Allan Ebdrup
I'm using dotNet 2.0 and VS 2005.
I have a datagrid that I'm binding to an object data source (ODS), the
objects in the ODS have an FromDate property and an Id property.
Now I want to display a hyperling if(FromDate>DateTime.Now) and a label if
not, how do I do this the best way?
I tried to do a if else in the item template, but that doesn't work:
------------------
<%#
if(((OFiR.Recruitment.Staffing.Reporting.PositionPostingReporting)Container.DataItem).FromDate
<asp:HyperLink Target="_blank"
NavigateUrl='<%#"/CPI/V2/Apps/PositionPosting/opening.aspx?id=" + Eval("Id")
%>' Text='<%# Eval("Title") %>' runat="server"></asp:HyperLink>
<%# } else {%>
<asp:Label runat="server" Text='<%# Bind("Title") %>'
id="Label1"></asp:Label>
<%# } %>
I have a datagrid that I'm binding to an object data source (ODS), the
objects in the ODS have an FromDate property and an Id property.
Now I want to display a hyperling if(FromDate>DateTime.Now) and a label if
not, how do I do this the best way?
I tried to do a if else in the item template, but that doesn't work:
------------------
<%#
if(((OFiR.Recruitment.Staffing.Reporting.PositionPostingReporting)Container.DataItem).FromDate
DateTime.Now) {%>
<asp:HyperLink Target="_blank"
NavigateUrl='<%#"/CPI/V2/Apps/PositionPosting/opening.aspx?id=" + Eval("Id")
%>' Text='<%# Eval("Title") %>' runat="server"></asp:HyperLink>
<%# } else {%>
<asp:Label runat="server" Text='<%# Bind("Title") %>'
id="Label1"></asp:Label>
<%# } %>