RegisterHiddenField Method

ClientScriptManager.RegisterHiddenField Method (String, String)


Registers a hidden value with the Page object.

Namespace:   System.Web.UI
Assembly:  System.Web (in System.Web.dll)

public void RegisterHiddenField(
	string hiddenFieldName,
	string hiddenFieldInitialValue


Type: System.String

The name of the hidden field to register.

Type: System.String

The initial value of the field to register.

Exception Condition

hiddenFieldName is null.

The RegisterHiddenField method creates a hidden <input> element on the rendered HTML page.

The following code example demonstrates the use of the RegisterArrayDeclaration and RegisterHiddenField methods. The example registers an array and a hidden value and defines the OnClick event of an <input> button to calculate the sum of two values of the array and the hidden value.

.NET Framework
Available since 2.0
Return to top
© 2015 Microsoft