开发者

Gridview loses its viewstate

开发者 https://www.devze.com 2022-12-16 16:27 出处:网络
In a page, i put a gridview with several template field columns. In one of the template field, i have a linkbutton. Before postback i bind the grid with data. Once page loads, when i click the linkbut

In a page, i put a gridview with several template field columns. In one of the template field, i have a linkbutton. Before postback i bind the grid with data. Once page loads, when i click the linkbutton in g开发者_运维知识库ridview, it is not firing the related event and its return a empty aspx page.


It sounds like you're not checking for a PostBack before running a DataBind(). If you continually bind your data, ViewState will be recreated each time and you'll lose what you had.

0

精彩评论

暂无评论...
验证码 换一张
取 消