Skip to main content

ASPxHiddenField Class

Represents a non visual component to store a set of values and synchronize them between the server and client sides across round trips.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.1.dll

NuGet Package: DevExpress.Web


public class ASPxHiddenField :
    IDictionary<string, object>,
    ICollection<KeyValuePair<string, object>>,
    IEnumerable<KeyValuePair<string, object>>,


The ASPxHiddenField component allows you to transfer values between server and client.

Create a Hidden Field

Design Time

The ASPxHiddenField control is available on the DX.23.1: Components toolbox tab in the Microsoft Visual Studio IDE.

HiddenField in Toolbox

Drag the control onto a form and customize the control’s settings, or paste the control markup in the page’s source code.

<dx:ASPxHiddenField ID="ASPxHiddenField1" ClientInstanceName="hiddenField" runat="server">

Run Time

using DevExpress.Web;
protected void Page_Load(object sender, EventArgs e)
    ASPxHiddenField hf = new ASPxHiddenField();
    hf.ID = "ASPxHiddenField1";
    hf.ClientInstanceName = "hiddenField";
Imports DevExpress.Web
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    Dim hf As ASPxHiddenField = New ASPxHiddenField()
    hf.ID = "ASPxHiddenField1"
    hf.ClientInstanceName = "hiddenField"
End Sub


DevExpress controls require that you register special modules, handlers, and options in the Web.config file. You can change this file or switch to the Design tab in the Microsoft Visual Studio IDE to automatically update the Web.config file. Note that this information is automatically registered if you use the DevExpress Template Gallery to create a project.

Client-Side API

The ASPxHiddenField‘s client-side API is implemented with JavaScript language and is exposed by the ASPxClientHiddenField object.


Available by default.

Client object type


Access name





The client-side API is always available for this control.

Dictionary Storage

The ASPxHiddenField is a dictionary that maintain an unlimited number of elements (key/value pairs). In a key/value pair, a key is a property name (a string) and a value - a property value (an object). Property names (keys) must be unique. Property names can contain any symbols except for the symbols | and # (the vertical bar and the hash sign).

See demo

Supported Value Types

You can store property values of different types in the hidden field.

The hidden field automatically preserves value types and does not require converting values to the required type. It allows you to manipulate the same value type both on the server and client sides.

Learn more


Use the ASPxHiddenField.SyncWithServer property to specify whether the control synchronizes its values between the client and server sides. Synchronization is in effect when either the control sends a postback or callback. Set the ASPxHiddenField.SyncWithServer property to false when you use the hidden field only to pass values from the server to the client. This minimizes data transfer between the client and the server.


ASPxHiddenField stores all its content in its own hidden input and does not use ViewState. As a result, the ASPxHiddenField’s properties are not automatically available across roundtrips to the client.

Online Demo

ASPxHiddenField - Example

See Also