Persisting the ViewState
-
hi all, i'm developing a Data-Bound Control, I was wondering if i have to save the ViewState of the DataSource, i mean what is the danger if i make the server always provide me with the DataSource between PostBacks by saving it in the Session Object so i don't need to send all the Data as a ViewState to the Client Side in each round trip. Does anyone know any drawbacks for this method, maybe like reserving the Server resources or anything, thanks for your help.
-
hi all, i'm developing a Data-Bound Control, I was wondering if i have to save the ViewState of the DataSource, i mean what is the danger if i make the server always provide me with the DataSource between PostBacks by saving it in the Session Object so i don't need to send all the Data as a ViewState to the Client Side in each round trip. Does anyone know any drawbacks for this method, maybe like reserving the Server resources or anything, thanks for your help.
Hi there, In my opinion, to make your control flexible, you should let that control work in the same way as other web controls do. I mean, the user should be given an option of enabling/disabling the ViewState. If he plans to disable the ViewState, he might need to save the data source in Session or reload from data store to bind to the control in every post to the server. In addition, as you know that we use the session model to store data and objects across multiple web requests. If you plan to save the data source in Session, you might also need to think about what you should do if your control is used in many places in your application and you need to ensure that the SessionID value to save the data source is unique to the control. For more information on this issue, you can take a quick look at these documents. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconChoosingServerStateOption.asp[^] http://msdn.microsoft.com/library/en-us/cpguide/html/cpconmantainingstateincontrol.asp[^]
-
Hi there, In my opinion, to make your control flexible, you should let that control work in the same way as other web controls do. I mean, the user should be given an option of enabling/disabling the ViewState. If he plans to disable the ViewState, he might need to save the data source in Session or reload from data store to bind to the control in every post to the server. In addition, as you know that we use the session model to store data and objects across multiple web requests. If you plan to save the data source in Session, you might also need to think about what you should do if your control is used in many places in your application and you need to ensure that the SessionID value to save the data source is unique to the control. For more information on this issue, you can take a quick look at these documents. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconChoosingServerStateOption.asp[^] http://msdn.microsoft.com/library/en-us/cpguide/html/cpconmantainingstateincontrol.asp[^]
thx again man ur giving me a gr8 help.
-
thx again man ur giving me a gr8 help.
-
simply pretty girls won't waste their time on writing such a clever replies