Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 975253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:33:25+00:00 2026-05-16T03:33:25+00:00

What does EnableViewState on a HyperLink do or mean? <asp:HyperLink ID=RegisterHyperLink runat=server EnableViewState=false>Register</asp:HyperLink> What

  • 0

What does EnableViewState on a HyperLink do or mean?

<asp:HyperLink ID="RegisterHyperLink" runat="server" EnableViewState="false">Register</asp:HyperLink>

What does it mean? and what will it do if I set it to true. Thanks! I looked it up, but the definition was not in simple terms.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:33:25+00:00Added an answer on May 16, 2026 at 3:33 am

    ViewState is used to persist the state of control properties across postbacks. Disabling it means that any properties you set programmatically (in code-behind) won’t be persisted across page postbacks. However, if you declare all the values declaratively (in your .aspx page) then disabling it won’t make any difference.

    A quick example:

    Say you have this aspx mark-up with ViewState enabled:

    <form id="form1" runat="server">
    <div>
        <asp:HyperLink ID="RegisterHyperLink" runat="server" EnableViewState="true">Register</asp:HyperLink>
        <br /><br />
        <asp:Button ID="ButtonPostBack" runat="server" Text="Post Back" />
    </div>
    </form>
    

    And you do this in code-behind:

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            RegisterHyperLink.ForeColor = System.Drawing.Color.Red;
        }
    }
    

    Even though you only set the ForeColor of the HyperLink to the colour red on the first load the HyperLink will still remain red after clicking the Button that performs the postback. That is because ViewState stores the value of the HyperLinks properties and re-creates them after postback.

    If you try the exact same thing but with ViewState disabled on the HyperLink, when you click the submit button the HyperLink will revert back to its original colour. That is because viewstate isn’t “storing” the fact that you set it to be red.

    In practical terms you can normally disable ViewState if:

    A) Your page doesn’t perform any postbacks
    B) You set all the properties declaratively

    If you really want to understand ViewState I’d recommend reading TRULY Understanding ViewState.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ImageButton in a GridView. <asp:GridView ID=ItemGridView runat=server DataKeyNames=Id OnRowDataBound=ItemGridView_RowDataBound AllowPaging=True AllowSorting=True
Does anyone know why UsernameExists wont return True. I must have my syntax messed
Was the new ViewStateMode property introduced to avoid breaking the existing EnableViewState? Does setting
I have following aspx page called search.aspx: <div id=wrap> <div id=menu> <div id=t_menus runat=server>
Does the following function cause stack overthrow eventually? var isFinish= false; function foo(){ //
When EnableViewstate = false and I do postback, my textbox control retains the text
Does anyone know if there is a way to generate different code in the
Does COUNT(*) have any significant impact for MySQL performance if query already has GROUP
Does anyone have a translate function for x/y positions after rotation in javascript? for
Does anyone know of a free tool, similar to what is built into Visual

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.