在执行编辑操作后删除记录时如何清除控件 [英] how to clear the controls when we delete the record after performing edit operation

查看:74
本文介绍了在执行编辑操作后删除记录时如何清除控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述







我有文本框控件和带删除按钮的网格。

当我们点击一​​个网格行并按下编辑按钮时,当我们点击删除按钮时,控制单元中显示的总数据。该记录从网格中删除,但控件没有清除。是否有任何建议




I have textbox controls and grid with delete buton.
when we click on row of a grid and press edit button,the total data displayed in controls.later when we click on delete button .the record is deleting from grid,but the controls are not clearing. Is there any suggestion for this

推荐答案

调用 GridView.DataBind()重新绑定网格的方法。要清除其他控件,可以编写一个通用方法,查找指定容器中的所有控件并重置它们。
Call GridView.DataBind() method to rebind the grid. To clear other controls you can write a generic method that find all controls within specified container and reset them.


http://forums.asp.net/t/1085050.aspx?OnClick+Event+for+Text+Box+ in + ASP + NET + with + C + [ ^ ]







http:/ /stackoverflow.com/questions/10880819/how-to-clear-value-of-all-textbox-on-asp-net-buttons-click [ ^ ]


这篇关于在执行编辑操作后删除记录时如何清除控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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