Posted on: 4/12/2011 9:33:58 AM | Views : 378

When reading the docs, it says CommandEventArgs can be used in combination with the OnCommand event to pass in the commandName and commandArgument parameters for extra control..
 
So when I have for example an imagebutton:
<asp:ImageButton ID="iBtnAddTo" runat="server" OnCommand="iBtnAddTo_Command" CommandName="addTo" CommandArgument="111" />
I can do this:
protected void iBtnAddTo_Command(object sender, CommandEventArgs e) { string matNr = e.CommandArgument.ToString(); }
However the above examples just returns empty values...
When I do the following:
<asp:ImageButton ID="iBtnAddTo" runat="server" Visible="false" OnClick="iBtnAddTo_Click" CommandName="addTo" CommandArgument="111" />
And:
protected void iBtnAddTo_Click(object s ...

Go to the complete details ...