CipherIS
asked on
ASP.NET repeater control
I have a repeater control
<asp:Repeater ID="rptFiles" runat="server" onitemcommand="rptFiles_It emCommand" >
<HeaderTemplate>
<strong>Downloadable Files:</strong><br />
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="lbDocs" runat="server"
Text="<%# ((Files)Container.DataItem ).FileName %>" /><br />
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:Repeater>
I want to know if it is possible to have a text and a value similar to a dropdown box? I need to display one value but actually capture another value on the click of the repeater.
Thanks
<asp:Repeater ID="rptFiles" runat="server" onitemcommand="rptFiles_It
<HeaderTemplate>
<strong>Downloadable Files:</strong><br />
</HeaderTemplate>
<ItemTemplate>
<asp:LinkButton ID="lbDocs" runat="server"
Text="<%# ((Files)Container.DataItem
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:Repeater>
I want to know if it is possible to have a text and a value similar to a dropdown box? I need to display one value but actually capture another value on the click of the repeater.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@BuggyCoder
Thanks for the solution. That works. How do I get the selected item? Below gives me the display name. The File Name is in the hidden field.
string sSelected = ((System.Web.UI.WebControl s.LinkButt on)(e.Comm andSource) ).Text;
Thanks for the solution. That works. How do I get the selected item? Below gives me the display name. The File Name is in the hidden field.
string sSelected = ((System.Web.UI.WebControl
So, set up the HashTable and then when the user clicks the repeater, grab that text and run it though the hashtable to get the value you want.