datalist issue

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>
 
G

Guest

You can use DataBind event of DataList to do more complex replace or changes
inside item template.
 
D

DC Gringo

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top