M
magister
Hi,
I got a query like this
select longTitle, startDate, endDate, eventId, eventUrl from events
I got a datagrid like this
<asp:datagrid id="DataGrid1" runat="server" enableviewstate="False"
autogeneratecolumns="False" useaccessibleheader="True">
<columns>
<asp:templatecolumn>
<itemtemplate>
<table border="0">
<tr>
<td align="right"><a href="eventdetail.aspx?eid=<%#
DataBinder.Eval(Container.DataItem, "eventId") %>"><%#
DataBinder.Eval(Container.DataItem, "longTitle") %></a></td>
</tr>
<tr>
<td align="right"><%# DataBinder.Eval(Container.DataItem, "startDate")
%></td>
</tr>
<tr>
<td align="right"><a href="eventreg.aspx?eid=<%#
DataBinder.Eval(Container.DataItem, "eventId") %>">Register for this
event</a></td>
</tr>
</table>
</itemtemplate>
</asp:templatecolumn>
</columns>
</asp:datagrid>
I want to change the URL of the first link to eventUrl if it is not
null....
How can I do this???
With private void DataGrid1_ItemDataBound I can't find my way into
this type of DataGrid
only 1 column with a table in it....???
With a method call in the actual DataGrid itself
<a href="<%# WhichLink(DataBinder.Eval(Container.DataItem,
"eventId"),DataBinder.Eval(Container.DataItem, "eventUrl") )
%>"><%#eventNAme %> etc....
I get funny error about types in the code behind....
Suggestions c-sharp like if poss....thanks
m@gs
I got a query like this
select longTitle, startDate, endDate, eventId, eventUrl from events
I got a datagrid like this
<asp:datagrid id="DataGrid1" runat="server" enableviewstate="False"
autogeneratecolumns="False" useaccessibleheader="True">
<columns>
<asp:templatecolumn>
<itemtemplate>
<table border="0">
<tr>
<td align="right"><a href="eventdetail.aspx?eid=<%#
DataBinder.Eval(Container.DataItem, "eventId") %>"><%#
DataBinder.Eval(Container.DataItem, "longTitle") %></a></td>
</tr>
<tr>
<td align="right"><%# DataBinder.Eval(Container.DataItem, "startDate")
%></td>
</tr>
<tr>
<td align="right"><a href="eventreg.aspx?eid=<%#
DataBinder.Eval(Container.DataItem, "eventId") %>">Register for this
event</a></td>
</tr>
</table>
</itemtemplate>
</asp:templatecolumn>
</columns>
</asp:datagrid>
I want to change the URL of the first link to eventUrl if it is not
null....
How can I do this???
With private void DataGrid1_ItemDataBound I can't find my way into
this type of DataGrid
only 1 column with a table in it....???
With a method call in the actual DataGrid itself
<a href="<%# WhichLink(DataBinder.Eval(Container.DataItem,
"eventId"),DataBinder.Eval(Container.DataItem, "eventUrl") )
%>"><%#eventNAme %> etc....
I get funny error about types in the code behind....
Suggestions c-sharp like if poss....thanks
m@gs