System.Web.UI.WebControls.HiddenField Class

Represents a hidden field used to store a non-displayed value.

See Also: HiddenField Members

Syntax

public class HiddenField : System.Web.UI.Control, System.Web.UI.IPostBackDataHandler

Remarks

In this topic:

Introduction

The System.Web.UI.WebControls.HiddenField control is used to store a value that needs to be persisted across posts to the server. It is rendered as an <input type= "hidden"/> element.

Normally view state, session state, and cookies are used to maintain the state of a Web Forms page. However, if these methods are disabled or are not available, you can use the System.Web.UI.WebControls.HiddenField control to store state values.

To specify the value for a System.Web.UI.WebControls.HiddenField control, use the HiddenField.Value property. You can provide a routine that gets called every time the value of the System.Web.UI.WebControls.HiddenField control changes between posts to the server by creating an event handler for the HiddenField.ValueChanged event.

Declarative Syntax

Example

<asp:HiddenField
    EnableTheming="True|

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0