SelectedItemTemplate does not show in datalist

R

Raymond Du

Hi,

I have the following templates inside a datalist:

<SelectedItemTemplate>
&nbsp;<%# Container.DataItem("Title") %>
</SelectedItemTemplate>
<ItemTemplate>
&nbsp;<asp:LinkButton id="lnkAction" runat="server" cssClass="OtherTabs"><%#
Container.DataItem("Title") %></asp:LinkButton>
</ItemTemplate>


The Titles show up regular items. But when an item is selected, Title
disappears, I only see a blank space. I am sure Title has value because it
shows when the item is not selected.

Any Ideas?

TIA
 
J

Johann MacDonagh

Chances are, it has to do with the way you are binding or the way you are
setting the SelectedIndex. Could you post some more code (specifically, the
entire DataList declaration, as well as the code-behind methods that bind
your data and set the SelectedIndex value. From what you've posted, it looks
as if your code will work, therefore, it must be something in your code
which is causing the problem.

Thanks,
Johann MacDonagh
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top