ASP:GridView How to access value of a control set in <EditItemTemplate>
In my Gridview when a user edits a row, I'm showing couple of asp:TextBox boxes using the EditItemTemplate.
One of the Text Box is bound to the UpdateParameters 开发者_JAVA百科of my asp:ObjectDataSource. However the Second Box is not bound to any of the update parameters. I'm assigning a custom value to the second box.
Now my problem is, when the row is updated how do i read the value of my second text box??
I tried catching the value of the second text box in Grid_RowUpdating and ObjectDataSource1_Updating but I'm unable to find the second control.
Try this
(GridView1.Rows[GridView1.EditIndex].FindControl("Textbox2") as TextBox).Text
精彩评论