How often do you use Postbacks on asp.net pages? How often do you use it in SharePoint? Well, if you are using postbacks you might know that if you bind your data to a source, e.g. a datatable, the datatable is null after postback. Ok, you can bind your data all the time again meaning you also making request every time against the datasource (database or sharepoint list, etc.).
Well, if you like to store the data which you will bind to a control in a place where it stays? I used the viewstate. I got the hint from this discussion. And used it right this way:
DataTable ds = new DataTable(); //... fill here your Datatable ViewState.Add("TicketDaten", ds); &amp;nbsp; //After Postback reload it ds = ViewState["TicketDaten"] as DataTable;
Hope it helps you!
..:: I Like SharePoint ::..The article or information provided here represents completely my own personal view & thought. It is recommended to test the content or scripts of the site in the lab, before making use in the production environment & use it completely at your own risk. The articles, scripts, suggestions or tricks published on the site are provided AS-IS with no warranties or guarantees and confers no rights.