Form.Footer Propriété

Définition

Retourne un panneau qui représente le pied de page du formulaire. Cette API est obsolète. Pour plus d’informations sur le développement d’applications mobiles ASP.NET, consultez Applications mobiles & Sites avec ASP.NET.

public:
 property System::Web::UI::MobileControls::Panel ^ Footer { System::Web::UI::MobileControls::Panel ^ get(); };
[System.ComponentModel.Bindable(false)]
[System.ComponentModel.Browsable(false)]
public System.Web.UI.MobileControls.Panel Footer { get; }
[<System.ComponentModel.Bindable(false)>]
[<System.ComponentModel.Browsable(false)>]
member this.Footer : System.Web.UI.MobileControls.Panel
Public ReadOnly Property Footer As Panel

Valeur de propriété

Panel qui représente le pied de page du formulaire.

Attributs

Exemples

L’exemple de code suivant montre comment utiliser la Footer propriété pour accéder au contenu du FooterTemplate.

Cet exemple provient d’un exemple plus grand pour la ControlToPaginate propriété .

void Form_Paginated(object sender, EventArgs e)
{
    // Set the background color based on 
    // the number of pages
    if (ActiveForm.PageCount > 1)
        ActiveForm.BackColor = Color.LightBlue;
    else
        ActiveForm.BackColor = Color.LightGray;

    // Check to see if the Footer template has been chosen
    if (DevSpec.HasTemplates)
    {   
        System.Web.UI.MobileControls.Label lbl = null;
        
        // Get the Footer panel
        System.Web.UI.MobileControls.Panel pan = Form1.Footer;

        // Get the Label from the panel
        lbl = (System.Web.UI.MobileControls.Label)pan.FindControl("lblCount");
        // Set the text in the Label
        lbl.Text = "Page #" + Form1.CurrentPage.ToString();
    }
}
Private Sub Form_Paginated(ByVal sender As Object, _
    ByVal e As EventArgs)
    
    ' Set the background color based on 
    ' the number of pages
    If ActiveForm.PageCount > 1 Then
        ActiveForm.BackColor = Color.LightBlue
    Else
        ActiveForm.BackColor = Color.LightGray
    End If
    
    ' Check to see if the Footer template has been chosen
    If DevSpec.HasTemplates Then
        Dim lbl As System.Web.UI.MobileControls.Label
        
        ' Get the Footer panel
        Dim pan As System.Web.UI.MobileControls.Panel = Form1.Footer

        ' Get the Label from the panel
        lbl = CType(pan.FindControl("lblCount"), System.Web.UI.MobileControls.Label)
        ' Set the text in the Label
        lbl.Text = "Page #" + Form1.CurrentPage.ToString()
    End If
End Sub

Dans cet exemple, étant donné qu’aucun filtre n’est spécifié pour l’élément <Choice> , il s’agit toujours de SelectedChoice. Pour spécifier un filtre, remplacez l’élément par : <Choice Filter="isPocketIE"> et incluez un fichier Web.config qui définit les filtres que vous souhaitez utiliser.

<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
<!-- The first Form -->
    <mobile:Form ID="Form1" Runat="server" 
        Paginate="true" OnActivate="Form_Activate" 
        OnPaginated="Form_Paginated">
        <mobile:link ID="Link1" Runat="server" 
            NavigateUrl="#Form2">
            Go To Other Form
        </mobile:link>
        <mobile:Label ID="Label1" Runat="server">
            Welcome to ASP.NET
        </mobile:Label>
        <mobile:textview ID="txtView" Runat="server" />
        
        <mobile:DeviceSpecific ID="DevSpec" Runat="server">
            <Choice>
                <FooterTemplate>
                    <mobile:Label runat="server" id="lblCount" />
                </FooterTemplate>
            </Choice>
        </mobile:DeviceSpecific>

    </mobile:Form>
    
    <!-- The second Form -->
    <mobile:Form ID="Form2" Runat="server" 
        Paginate="true" OnPaginated="Form_Paginated">
        <mobile:Label ID="message2" Runat="server">
            Welcome to ASP.NET
        </mobile:Label>
        <mobile:link ID="Link2" Runat="server" 
            NavigateUrl="#Form1">Back</mobile:link>
    </mobile:Form>
</body>
</html>

S’applique à

Voir aussi