+ Reply to Thread
Results 1 to 2 of 2

Thread: Turn ViewState on for the controls that need ii

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    3

    Turn ViewState on for the controls that need ii

    I want to turn off ViewState for an entire page and then just want to turn it on for the controls that need it. How can I do that?

  2. #2
    Junior Member
    Join Date
    Oct 2012
    Posts
    7
    To disable view state for a page and to enable it for a specific control on the page, set the EnableViewState property of the page and the control to true, set the ViewStateMode property of the page to Disabled, and set the ViewStateMode property of the control to Enabled.

    The default value of the ViewStateMode property for a page is Enabled. The default value of the ViewStateMode property for a Web server control in a page is Inherit. As a result, if you do not set this property at either the page or the control level, the value of the EnableViewState property determines view-state behavior.

    The ViewStateMode property of a page or a control has an effect only if the EnableViewState property is set to true. If the EnableViewState property is set to false, view state will be turned off even if the ViewStateMode property is set to Enabled.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts