无法在GridView中保留文本框的值 [英] unable to retain a value of textbox in gridview

查看:78
本文介绍了无法在GridView中保留文本框的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个带有dropdownlist和textbox控件的gridview.

我正在gridview的每一行中使用javascript根据textbox1的值在textbox2中生成一个值.在textbox2的onblur()函数中,我禁用了textbox2.

在文本框之前,gridview的每一行都有下拉列表.当我在第一行中禁用textbox2并在第二行中选择dropdownlist的值时,第一行中的textbox2的值不可见.

我尝试使用viewstate进行尝试,但无法保留该值.

我在Google中进行了搜索,但可以找到合适的解决方案

请帮助我.....

Hi,

I am having a gridview with dropdownlist and textbox controls.

I am generating a value in the textbox2 depending on the textbox1 value using the javascript in every row of gridview. In onblur() function of textbox2, I am disabling the textbox2.

Before textboxes, I am having dropdownlist''s in every row of gridview. when I disable the textbox2 in the first row and select the value of dropdownlist in the second row, the value of textbox2 in first row is not visible.

I tried by using the viewstate but I am unable to retain the value.

I searched in google but I could get the appropriate solution

Please help me.....

推荐答案

您是否使用过asp:UpdatePanel?

当我使用下拉列表和文本框以及ASP.NET时,我在要更新的控件周围使用更新面板",然后将触发器设置为该控件(在您的情况下,可能是文本框"?)

尝试使用更新面板将页面的这一区域包围起来,看看它是如何工作的.

我不知道这篇文章是否会在CodeProject上为您提供帮助.
http://www.codeproject.com/KB/webforms/GridViewFilter.aspx [ ]

祝你好运

罗布
Have you used the asp:UpdatePanel?

When I am working with Drop Down Lists and Textboxes and ASP.NET I use Update Panels around the control that I want to update and then set the trigger to be the control (in your case the Textbox perhaps?)

Try surrounding this area of yous page with the update panel, and see how that works.

I wonder if this article posted on CodeProject will help you.
http://www.codeproject.com/KB/webforms/GridViewFilter.aspx[]

Good luck

Rob


这篇关于无法在GridView中保留文本框的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆