Use commadargument to transmit multiple values in data binding controls such as gridview datalist Repeater
SourceCodeAs follows (ASPX page code): This code is generally written in the item template. If you use the first method, you do not need to add an onclick event to directly click rowcommand of the data binding control. The itemcommand event will work.
<Asp: imagebutton id = "editimagebutton" runat = "server" imageurl = "~ /Images/bt_edit.gif "commandargument = '<% # eval (" dict_id ") +", "+ eval (" dict_type ") %> 'onclick = "editimagebutton_click" Height = "20" width = "20"/>
Method 1;
If you use the gridview control to find the datalist used by double-clicking the rowcommand event, the repeater control will find the itemcommand event double-click
The background code is as follows:
Object [] Arg = E. commandargument. tostring (). Split (','); // note that it is a single quotation mark.
String arg0 = Arg [0]. tostring ();
String arg1 = Arg [1]. tostring ();
Method 2: add the linkbutton control to the item template. You can manually add an onclick event to the control.
Linkbutton LBT = (linkbutton) sender;
Object [] Arg = LBT. commandargument. tostring. Split (',');
String arg0 = Arg [0]. tostring ();
String arg1 = Arg [1]. tostring ();
Method 3: Use a hyperlink to pass a value
<A href = "default. aspx? Id = <% # eval ("dict_id") %> & type = <% # eval ("dict_type") %> "> jump to the default. aspx page </a>