The front-end design is as follows:
The "edit" column is what we are talking about today. Click the edit link to load the data in the row of the GridView control to the Edit page. Then, you can modify the data. Edit a column. The foreground code example is as follows:
<Asp: TemplateField HeaderText = runat => <ItemTemplate> <asp: LinkButton ID = CommandName = runat = CommandArgument => edit </asp: LinkButton> </ItemTemplate> </asp: templateField>
The Edit link property CommandArgument has multiple parameters, which are actually the values of each column in The GridView control. Use the RowCommand event of the GridView control to upload the value to the editing interface.
GridView_RowCommand( (e.CommandName.Equals([] estr = e.CommandArgument.ToString().Split( ID = Convert.ToString(estr[ NAME = Convert.ToString(estr[ TNAME = Convert.ToString(estr[ IP = Convert.ToString(estr[ PORT = Convert.ToString(estr[ TIME = Convert.ToString(estr[ LOCATION = Convert.ToString(estr[ MISC = Convert.ToString(estr[ + ID + + NAME + + TNAME + + IP + + PORT + + TIME + + LOCATION + + MISC,
The above code is to bind the row data value of the GridView control to the background, jump through Response. Redirect () and then upload the value to each control on the editing page. You need to load the uploaded data in the Page_Load () method of the background code on the editing page,
Page_Load( (! (Request.QueryString[] != && Request.QueryString[].ToString().Trim() != .txtid.Text = Request.QueryString[.txtname.Text = Request.QueryString[.DropDownList_tname.Text = Request.QueryString[.txtip.Text = Request.QueryString[.txtport.Text = Request.QueryString[.txttime.Text = Request.QueryString[.txtlocation.Text = Request.QueryString[ .txtmisc.Text = Request.QueryString[
For example, if you click the data row numbered "19", the editing page displays the following results,
This is what we are talking about today. After passing the value, you can change it as needed and update the data to the background database...
For reference only !!!