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.
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.
This is by design. This data is not stored anywhere natively from page load to page load. You will need to perform one of the following 3 tasks:
My preference is to make return trips to the database when I need to and keep my SQL tuned for performance. Heavy page loads are annoying, and too much session memory can cause slowing on the server. I believe you can also store this data in cache, but I've never attempted it so I don't know what the limitations or capabilities there are.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With