Click the edit link in the Gridview control and send this line of data to the editing interface for modification.

Source: Internet
Author: User

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 !!!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.