.net – GridView loses data during postback

gridviewnetpostback

I have an aspx.Page containing a gridview. The gridview is bound in code behind to a datasource only when no postback takes place and has enableviewstate = true (The page too). During a postback, the data bound to the gridview are lost. What could be the reason. Please ask if code is needed.

Best Answer

Solved it, problem was I made a Page.Databind() in the Page_Load event of the masterpage of the page with the gridview, so it bound the gridview during each postback without data. Thanks for all efforts.

Related Topic