This documentation is archived and is not being maintained.

Page.RegisterRequiresPostBack Method

Registers a control as one that requires post-back handling.

[Visual Basic]
Public Sub RegisterRequiresPostBack( _
   ByVal control As Control _
public void RegisterRequiresPostBack(
 Control control
public: void RegisterRequiresPostBack(
 Control* control
public function RegisterRequiresPostBack(
   control : Control


The control to be registered.


[Visual Basic, C#] The following example uses the RegisterRequiresPostBack method to require a customized text box control, customTextBox, to be posted back before any code associated with the text box will execute.

[Visual Basic] 
Sub Text_Change(sender As Object, e As EventArgs)
   myLabel.Text = "<b>Welcome " + myTextBox.Text + " to ASP.NET</b>"
End Sub 'Text_Change

Sub Page_Load(sender As Object, e As EventArgs)
   If Not IsPostBack Then
   End If
End Sub 'Page_Load

void Text_Change(object sender, EventArgs e)
   myLabel.Text = "<b>Welcome " + myTextBox.Text + " to ASP.NET</b>";
void Page_Load(object sender, EventArgs e)

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

Page Class | Page Members | System.Web.UI Namespace