Last post Oct 03, 2011 01:27 PM by sprabha
Sep 30, 2011 02:51 PM|sprabha|LINK
I have a page where number of dynamic controls are displayed, and when i postback the page i can still able to display the dynamic data and controls, but when i leave the page and come back, i am loosing that data in ViewState. I tried to store it in session
variable but there are too many dynamic controls that i can assign data to from session variable? could anybody please help me on this?
Thank you so much!
Oct 02, 2011 10:38 AM|nobdy|LINK
Viewstate has scope limited to Page . so when you leave the page and come back again, Viewstate is reloaded. you have to store variables in Session to solve this issue.
Oct 02, 2011 12:42 PM|Dotnetfreaks|LINK
You cann't store value in ViewState you will have to store dynamic controls value in Session and the best way to store the value in Session. Create a class and add property in newly added class for each control and create object of that class and assign
the dynamic controls value and store class object in Session. in this way you have only one Session object and you can access all dynamic control values from single object ranther creating Session object for each dynamic control.
I hope this will solve your problem.
if you need code, let me know
Oct 03, 2011 01:27 PM|sprabha|LINK
I figured it out, I did the same thing used session variables.