启用Gridview的ViewState属性 [英] Enable ViewState property of Gridview

查看:138
本文介绍了启用Gridview的ViewState属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

- 何时将gridview的EnableViewState属性设为true / False?请帮忙。

--When shall i make the EnableViewState property of gridview to be true/ False ? Kindly help.

推荐答案

如果你想在页面中保持gridview的状态。



即如果你想在你的代码中的某个地方使用与你的gridview绑定的数据表,那么你可以将数据表保存在viewstate中,并且可以在其他地方获取它。



以这种方式,你的gridview的当前状态在视图状态中持久存在以供进一步使用。



因此,如果网格视图具有启用的视图状态,那么处理坚持数据。



希望这会有所帮助。



关于viewstate,你可以访问。



[ ^ ]



[ ^ ]



[ ^ ]
If you want to maintain the state of your gridview in your page.

i.e. if you want to use that datatable with which you are binding your gridview somewhere else in your code.. than you can save the datatable in viewstate and can get it somewhere else.

in this way that current state of your gridview is persisted in viewstate for further use.

So having a gridview with enabled view state is gud idea to handle the persistance of data.

hope that will help.

Further about viewstate you can visit.

[^]

[^]

[^]


这篇关于启用Gridview的ViewState属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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