datalist issue

  • Thread starter Thread starter DC Gringo
  • Start date Start date
D

DC Gringo

I have a datalist that will always return 2 records. The first record
should be called "Latest Edition", the second "Previous Edition". How can I
identify which is which in the .net code and replace have this label show up
correctly. Below, I have hardcoded in "Latest Edition"..

<asp:DataList id="DataList1" runat="server" DataSource='<%#
DataBinder.Eval(DsEobNew1, "Tables[fn3ExecBriefHome]") %>'
DataMember="fn3ExecBriefHome" DataKeyField="gc_id" SHOWHEADER="False"
SHOWFOOTER="False">

<ITEMTEMPLATE>
. <B>Latest Edition</B> - <A HREF="index.aspx?pageID=eobDoc&g=<%#
DataBinder.Eval(Container, "DataItem.gc_id") %>"><%#
DataBinder.Eval(Container, "DataItem.published") %></A>
</ITEMTEMPLATE>

</ASP:DATALIST>
 
You can use DataBind event of DataList to do more complex replace or changes
inside item template.
 
Could you elaborate a bit on this? Code sample perhaps?

_____
DC G

Shailesh Jannu said:
You can use DataBind event of DataList to do more complex replace or changes
inside item template.

DC Gringo said:
I have a datalist that will always return 2 records. The first record
should be called "Latest Edition", the second "Previous Edition". How can I
identify which is which in the .net code and replace have this label show up
correctly. Below, I have hardcoded in "Latest Edition"..

<asp:DataList id="DataList1" runat="server" DataSource='<%#
DataBinder.Eval(DsEobNew1, "Tables[fn3ExecBriefHome]") %>'
DataMember="fn3ExecBriefHome" DataKeyField="gc_id" SHOWHEADER="False"
SHOWFOOTER="False">

<ITEMTEMPLATE>
. <B>Latest Edition</B> - <A HREF="index.aspx?pageID=eobDoc&g=<%#
DataBinder.Eval(Container, "DataItem.gc_id") %>"><%#
DataBinder.Eval(Container, "DataItem.published") %></A>
</ITEMTEMPLATE>

</ASP:DATALIST>
 
Back
Top