asp.net - Dataset manually put into the viewstate of a Web UserControl not kept after postback -


I have created a web user control that is placed on the page at design time. Its purpose is to pop up with the grid of objects that the user has chosen so I have got a gridview on it. And in this code usercontrol:

  as the public property datatable () data. If you do not get the datalet (viewtest ("_ selectGridDataTable")) see VistaStast ("_grigreddatable") or return nothing if Setting the End Gadget (ByVal value as Data.DataTable) ViewState ("_ConnectGridDataTable") = Value and set end and property  

So when the user clicks on a button on the page, I put it in the code on the page:

  SelectGrid2.DataTable = GetContacts () .Tables (0) SelectGrid2.Show ()  

And it works fine. Grid pop up (using jQuery) and grid is shown. The problem is, when the user clicks the "OK" button on the user controller, the viewstate ("_giftgrid data") is always nothing and I can not get it because it is in the viewer ..?!? So what does the mean of viewerat actually mean?

Ohs I did not know that viewer is not present during page_int. I took my check for data loading for page load, and now it works. Thanks Mitchell to give me the idea of ​​checking this ..


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -