Export (0) Print
Expand All

Form Property (Common)

.NET Framework 1.1

Provides access to the containing form.

public System.Web.UI.MobileControls.Form Form {
   get
}

Inheritance

The following is a list of the classes that inherit the Form property from the MobileControl base class.

AdRotator Class PagedControl Class
Calendar Class Panel Class
Command Class PhoneCall Class
CompareValidator Class RangeValidator Class
CustomValidator Class RegularExpressionValidator Class
Form Class RequiredFieldValidator Class
Image Class SelectionList Class
Label Class TextBox Class
Link Class TextControl Class
List Class TextView Class
ObjectList Class ValidationSummary Class

Example

The following example demonstrates how to use the Form property to determine whether the active form is a particular form in the ASP.NET mobile Web application.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If (ActiveForm.ID.ToString() = Form3.Form.ID.ToString()) Then
            Dim Label1 As Label = New Label()
            Label1.Text = "Form.ID is Form3"
            Label1.Alignment = Alignment.Center
            Form3.Form.Controls.Add(Label1)
        End If
[C#]
private void Page_Load(object sender, System.EventArgs e)
{
   if (ActiveForm.ID == Form3.Form.ID)
   {
      Label Label1 = new Label();
      Label1.Text = "Form.ID is Form3";
      Label1.Alignment = Alignment.Center;
      Form3.Form.Controls.Add(Label1);   
   }   
}
Show:
© 2014 Microsoft