Share via


Header Property

Returns the panel that contains the form header. A header must be defined as a template and chosen for the target device.

public Panel Header {
   get
}

Example

The following example demonstrates how to use the Header property to access the controls in the HeaderTemplate.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

((Label)Form1.Header.FindControl("lblCount")).Text = "Page no is " + 
       Form1.CurrentPage.ToString();

End Sub

<mobile:form id="Form1" runat="server" paginate="true" 
   OnPaginated="Form_Paginated" >
   <DeviceSpecific>
      <Choice>
         <HeaderTemplate>
           <mobile:Label runat="server" id="lblCount" />
         </HeaderTemplate>
       </Choice>
   </DeviceSpecific>
</mobile:form>

[C#]

void Form_Paginated(object sender, EventArgs e)
{
   ((Label)Form1.Header.FindControl("lblCount")).Text = "Page no is " + 
       Form1.CurrentPage;
}

<mobile:form id="Form1" runat="server" paginate="true" 
   OnPaginated="Form_Paginated" >
   <DeviceSpecific>
      <Choice>
         <HeaderTemplate>
           <mobile:Label runat="server" id="lblCount" />
         </HeaderTemplate>
       </Choice>
   </DeviceSpecific>
</mobile:form>

See Also

Applies to: Form Class