GridView itemtemplate field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vajrala Narendra
    New Member
    • Jun 2007
    • 73

    GridView itemtemplate field

    hi,
    in gridview i took item template fields as textboxes . am trying to insert those textbox values into database. i dont know how to write code please suggest me. it is urgent to me.

    Thankyou.
  • nateraaaa
    Recognized Expert Contributor
    • May 2007
    • 664

    #2
    You will need to create a new instance of a textbox control and then use the findControl method to find the textbox in your gridview.

    Code:
     
    TextBox txt = (TextBox)GridView1.Row[0].FindControl("TextBox1");
    Then insert txt.Text into your stored procedure to save the text entered in the textbox into your database.

    Nathan

    Comment

    Working...