You must Sign In to post a response.
  • Category: ASP.NET

    Which are the objects and controls will get clear when postback

    Hai All,

    May I know which are the controls and objects values will get clear when postback happens with example please

    My doubt is when to use viewstate, hence need to know which are the objects and controls will be clear when postback happens


    Thanks and Regards,
    A.L.Chellappan
  • #761199
    Hi
    Chellpan

    Post Back Scenario we have lost all controls value.
    So we have maintain session or viewstate

    we can overcome this issue we need to state management concept so we can assign viewstate
    But all our controls will be lost when the page postback.

    Name : Dotnet Developer-2015
    Email Id :kumaraspcode2009@gmail.com

    'Not by might nor by power, but by my Spirit,' says the LORD Almighty.

  • #761207
    if there is post back, all values will clear, session values will be there.

    But there is Partial Post backing, which will keep the data in the place holders...

    Do Good... Enjoy your life.....

  • #761213
    Hi,

    When postback happens what are all the controls are available in page all controls gets clear. After post back happens page loads freshly,

    If you want to know about stating controls state.

    1) Viewstate -- Viewstate will maintain state until page close.

    2) Session -- Session will maintain state until session timeout expire, default timeout is 20mins.

    3) Cookie -- Cookie stored in local system once you delete it automatically cookie expired, you can do this using code logic also.

    4) Cache -- based on user request we can maintain state no of days using cache until expires the no of days cache maintain the state.

    5) Application -- until all objects are destroyed Application maintain state, for ex multiple people are logged in one application until all the people are logged out application maintain state, i.e. for each user session expires until that application maintain the state.

    Hope you understood, if you want to know more details about this my suggestion is better to read few articles about the above features.

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #761241
    Hi Chellapan.

    You have to understand in which phase view state data is stored, in which phase we have to modify the control values to ensure that values won't get effected even in the postback events.

    Go through the complete page life cycle and different phases.

    LoadComplete: All controls are loaded.

    PreRender: If we want to make any changes to
    viewstate values or changes to control properties
    we have to do here.

    SaveState: saves all changes including viewstate.

    Render: actual html content is rendered as out
    put.

    Regards

    Thota Sridhar.
    If you learn from defeat..
    You haven't really lost..

    Sridhar Thota.
    Editor: DNS Forum.


Sign In to post your comments