Gridview文本框在回发时释放其内容 [英] Gridview Textbox looses its content on postback

查看:92
本文介绍了Gridview文本框在回发时释放其内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在创建订单表格,我有Gridview,我从数据库表中获取三列,即Id,Name和price,并添加了第四列作为带有TextBox的新模板字段作为数量,对于gridview,允许分页为每页5行.

在文本框中输入数量后,当我单击网格视图"页面索引时,文本框的内容将丢失.

我想在每个Gridview页上放置所有项目的数量,然后将所有选择的行添加到新的Gridview中,其中删除行"链接主要有四列和第五列,请为此提供帮助.方案

EnableViewState ="true":如果在控件上设置了此属性,则可以在回发时保持数据活动,请在控件上进行尝试,如果不起作用,请告诉我! /blockquote>

Hi
I am creating the order form I have Gridview where I am fetching three columns from database table namely Id, Name And price , and added fourth column as new template field with TextBox for quantity, and for gridview allow paging is true with 5 rows per page.

After putting quantity in text-boxes When I click on Grid View page index the text box contents gets lost.

I want to put quantity on each Gridview page for all items and then want to add that all selecetd rows to new Gridview With mainly four columns and fifth column for Remove Row link please help me for this.

解决方案

EnableViewState = "true" : if you set this at your control you can keep your data alive on post back, try it on your control, if it doesn''t work tell me to know!


这篇关于Gridview文本框在回发时释放其内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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