In the jump between the pages, often used to pass the value, which may pass multiple values, below to introduce the next asp.net to pass multiple values to other pages of the method, the need for friends can refer to the following
In web development, jumps between pages are often used to pass values, which may pass multiple values. Commadargument multiple values to other pages. in data-bound controls such as the GridView DataList Repeater, you can use Commadargument to pass multiple values. Source code (ASPX page code) is as follows: This code is generally written in the item template, if you use the first method does not need to add onclick event, directly click on the data-bound control Rowcommand, ItemCommand event, on the line. Code as follows: <asp:imagebutton id= "Editimagebutton" runat= "Server" imageurl= "~/images/bt_edit.gif" Commandargument= ' <% #Eval ("dict_id") + "," +eval ("Dict_type")%> ' onclick= ' editimagebutton_click ' Height= ' "20" Width= "/> " Method 1, if you use the GridView control, find the Rowcommand event double-click, use the Datalist,repeater control to find the ItemCommand event double-click, The background code is as follows: code as follows: object[] arg=e.commandargument.tostring (). Split (', '); Note the single quotes string arg0=arg[0]. ToString (); string arg1=arg[1]. ToString (); Method 2, put the LinkButton control in the item template. This is more commonly used, you do this control plus the onclick event. The following table code is: code as follows: LinkButton lbt= (LinkButton) sender; object[] ARG=LBT. CommandArgument.ToString.split (', '); string arg0=arg[0]. ToString (); string arg1=arg[1]. ToString (); Second, the use of hyperlinks to pass values, but also a common method foreground code: code as follows: <a href= "default.aspx?id=<% #Eval (" dict_id ")%>&type= <% #Eval ("Dict_type")%> "> Skip to Default.aspx page </a> background: code as follows: String strdict_id = request.querystring["dict_id"]; string strdict_type= request.querystring["Dict_type"];