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

    what is the use of EnableViewState ? how to use it ?


    Are you looking for a way to know information about EnableViewState ? want to know how to set it ? then read this thread to know more about it



    What does the "EnableViewState" property do? Why would I want it on or off?
  • #735274
    As we know ViewState is the statemanagment technique, which used to persist the control values between postback for same page, so if you want to keep your value alive after postback then you can use it.
    just make the enable viewstate.
    see below code snippet

    //enable view state for label
    <asp:Label ID="lbltest" runat="server" Text="this is test label" EnableViewState="true" />

    hope it helps

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #735275
    EnableViewState is a feature which help us to save or persist the value of the controls during the postback or not. If you want to persist the value set it true otherwise false.
    Regards,
    Sugandha
    Microsoft Certified Technology Specialist
    MY Blog..

  • #735285
    whenever you are doing some page navigations Enableviewstate will save the data of the present controls if it is true otherwise your data will be lost.
    SRI RAMA PHANI BHUSHAN KAMBHAMPATI

  • #735288
    Hi srinivas kotha,

    By default ViewState data is not secure to make it secure we have a property called as EnableViewStateMac has to be "TRUE". If it's true then data become secure otherwise not secure. That's the reason we are using EnableViewStateMac property.

    Hope this will help you to resolve the issue.

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

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

  • #735339
    Hai Srinivas Kotha,
    Automatic persistent of form data during the post back implementation is called as View State.
    As the Web is stateless so it doesn't recognize anything when any post-back happens. each time a new page gets created with all it's events.
    Soto retain the original content, we have the feature called EnableViewState at the page level in which we an retain the original content of the page and regenerate the whole page and populate the same content.
    Internally it gets the check-sum of all the controls and then create a BASE 64 encrypted content and place in the same page so that when the page gets loaded again after the post back, again it check and based on the content renders the page contents.
    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com

  • #735381
    EnableViewState

    is the property used to set or reet the option for your View State in the page,.

    The VIew state is the property that preserver the values of the controls during the post back.

    for example a text back value does not clear when you do the post back.

    Thanks & Regards
    Anil Kumar Pandey
    Microsoft MVP, DNS MVM

  • #735412
    [Response removed by Admin. Read forum policies.]

  • #735452
    Enable View state is used to maintain the page state of the object.

    it will maintain post back preserve the values of the server..


  • Sign In to post your comments