D
David
I have a template field in a GridView that contains two ImageButtons.
When the user clicks one of the buttons, the GridView's RowCommand
event is fired and I can get the CommandName. All that is fine.
However, e.CommandArgument is an empty string, presumably because the
CommandArgument property of the ImageButtons is not set.
Is there some way, in the markup, to set the CommandArgument to the row
index?
<ItemTemplate>
<asp:ImageButton ID="btnSave" runat="server"
CommandName="Save" ImageUrl="~/Images/Diskette.gif"
CommandArgument="SOMETHING HERE" />
<asp:ImageButton ID="Email" runat="server"
CommandName="Email" ImageUrl="~/Images/Envelope.gif"
CommandArgument="SOMETHING HERE" />
</ItemTemplate>
TIA,
David
When the user clicks one of the buttons, the GridView's RowCommand
event is fired and I can get the CommandName. All that is fine.
However, e.CommandArgument is an empty string, presumably because the
CommandArgument property of the ImageButtons is not set.
Is there some way, in the markup, to set the CommandArgument to the row
index?
<ItemTemplate>
<asp:ImageButton ID="btnSave" runat="server"
CommandName="Save" ImageUrl="~/Images/Diskette.gif"
CommandArgument="SOMETHING HERE" />
<asp:ImageButton ID="Email" runat="server"
CommandName="Email" ImageUrl="~/Images/Envelope.gif"
CommandArgument="SOMETHING HERE" />
</ItemTemplate>
TIA,
David