This documentation is archived and is not being maintained.

ScriptManager::RegisterHiddenField Method (Page, String, String)

Registers a hidden field with the ScriptManager control during every asynchronous postback.

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

public:
static void RegisterHiddenField(
	Page^ page, 
	String^ hiddenFieldName, 
	String^ hiddenFieldInitialValue
)

Parameters

page
Type: System.Web.UI::Page

The page object that is registering the hidden field.

hiddenFieldName
Type: System::String

The name of the hidden field to register.

hiddenFieldInitialValue
Type: System::String

The initial value of the hidden field.

ExceptionCondition
ArgumentNullException

page is nullptr.

- or -

hiddenFieldName is nullptr.

You use the RegisterHiddenField method to register a hidden field that is compatible with partial-page rendering and that has no Microsoft AJAX Library dependencies. This method registers the hidden field every time that an asynchronous postback occurs. To register a hidden field for a control that is inside an UpdatePanel control so that the field is registered only when the panel is updated, use the RegisterHiddenField(Control, String, String) overload of this method.

If you want to register a hidden field that does not pertain to partial-page updates, and if you want to register the hidden field only one time during initial page rendering, use the RegisterHiddenField method of the ClientScriptManager class. You can get a reference to the ClientScriptManager object from the ClientScript property of the page.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5
Show: