Assembly: System.Web (in system.web.dll)
/** @property */ public boolean get_EnableViewStateMac () /** @property */ public void set_EnableViewStateMac (boolean value)
public function get EnableViewStateMac () : boolean public function set EnableViewStateMac (value : boolean)
Property Valuetrue if the view state should be MAC checked and encoded; otherwise, false. The default is true.
Set the EnableViewStateMac property to true when a high degree of data integrity is required between postbacks, or where there is a high risk of tampering.
In most circumstances, do not set this property in code. Set the EnableViewStateMac attribute to true using the @ Page directive in the .aspx file. When the page is requested, the dynamically generated class sets the property.
A view state MAC is an encoded version of the hidden variable that a page's view state is persisted to when sent to the browser. When you set the EnableViewStateMac attribute to true, the encoded and encrypted view state is checked to verify that it has not been tampered with on the client.
This attribute should never be set to false in a production Web site, even if the application or page does not use ViewState. The view-state MAC helps ensure the security of other ASP.NET functions in addition to view state.