开发者

How can I access a data repeater's item by index instead of explicit name?

开发者 https://www.devze.com 2022-12-31 11:56 出处:网络
Right now I\'m using the following code in my markup: <asp:Hi开发者_StackOverflow社区ddenField ID=\"TheName\" runat=\"server\" Value=<%#Eval(\"SpeakerName\")%> />

Right now I'm using the following code in my markup:

<asp:Hi开发者_StackOverflow社区ddenField ID="TheName" runat="server" Value=<%#Eval("SpeakerName")%> />

I would like to use:

<asp:HiddenField ID="TheName" runat="server" Value=<%#Eval(0)%> />

I would like to be able to call it by index instead of explicitly by "SpeakerName". Is there a way to do this in ASP.NET 4.0?


Try this:

<asp:HiddenField ID="TheName" runat="server" Value=<%# Eval("[0]") %> />
0

精彩评论

暂无评论...
验证码 换一张
取 消