I have an ASP.Net page that displays a list of options for the user. When they select from the list, it returns a message and queries the sql server. The results are displayed in the list below the options in the update panel. The following is an ItemTemplate snippet:
<asp:LinkButton Text="Save IT" OnCommand="SaveIt" CommandArgument="<%# Container.DataItemIndex %>" runat="server" />
DataItemIndex does not appear, so my command value is empty. However, the sender of the object is the button in which the item is displayed.
Why is the index element not showing in CommandArgument?
Maybe this message? If so, why will it be a post? Is there any way around this?
Edit: Due to my attempts to resolve this earlier, I posted the code, but it still does not appear.
Resolution: I found another job in that the OnCommand sender is a link button that has a CommandArgument. I will flag this issue to be a problem with multiple postbacks and javascript.
kevindaub
source share