开发者

ASP:GridView How to access value of a control set in <EditItemTemplate>

开发者 https://www.devze.com 2022-12-21 05:38 出处:网络
In my Gridview when a user edits a row, I\'m showing couple of asp:TextBox boxes using the 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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号