Gridview中的Viewstate [英] Viewstate in Gridview
问题描述
我在Web应用程序中的gridview存在此问题:我在更新面板上具有此gridview,并且我想在用户单击搜索"页面时更新数据.按钮.用户完成搜索并在其中选择一条记录后 gridview,我想在我的代码中获取此选定记录并获取其内容.
I have this problem with a gridview in a webapplication: I have this gridview on an update panel and i want to update the data when the user clicks on a "search" button. After the user has completed his search and selected a record in this gridview, i want to get this selected record in my code behind and get the contents.
问题是每次用户单击按钮时都会有一个回发.使用此回发,Gridview返回为空,我必须再次将其填充.
Problem though is that there is a postback each time the user clicks a button. With this postback the Gridview is returned empty and i have to fill it all over again. Is there a standard way to implement this?
推荐答案
请将按钮和gridview都放在更新面板中.
Please put both button and gridview in update panel.
否则,您必须为button_click编写触发器.
otherwise you have to write trigger for button_click.
要解决您的问题,最好在此处粘贴代码.
To resolve you problem, its better if you paste you code here.
谢谢
Nikunj Padaliya
Nikunj Padaliya
这篇关于Gridview中的Viewstate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!