locked
loosing dynamic data when i am navigating from one page to another RRS feed

  • Question

  • User454882645 posted

    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!

    Friday, September 30, 2011 2:51 PM

Answers

  • User1446927574 posted

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, October 2, 2011 10:38 AM

All replies

  • User1446927574 posted

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, October 2, 2011 10:38 AM
  • User-1250906048 posted

    Hi

     

    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

     

    Cheers!!!!

    Sunday, October 2, 2011 12:42 PM
  • User454882645 posted

    I figured it out, I did the same thing used session variables.

    Thank You.

    Monday, October 3, 2011 1:27 PM