Form.Footer Свойство

Определение

Возвращает панель, представляющую нижний колонтитул для формы. Этот API устарел. Сведения о разработке ASP.NET мобильных приложений см. в статье Мобильные приложения & сайты с 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

Значение свойства

Объект Panel, представляющий нижний колонтитул для формы.

Атрибуты

Примеры

В следующем примере кода показано, как использовать Footer свойство для доступа к содержимому FooterTemplateобъекта .

Этот пример является примером большего размера для ControlToPaginate свойства .

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

В этом примере, так как для <Choice> элемента не указан фильтр, он всегда будет .SelectedChoice Чтобы указать фильтр, измените элемент на и <Choice Filter="isPocketIE"> включите файл Web.config, определяющий фильтры, которые вы хотите использовать.

<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>

Применяется к

См. также раздел