Form.Footer Właściwość
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Zwraca panel reprezentujący stopkę formularza. Ten interfejs API jest nieaktualny. Aby uzyskać informacje na temat tworzenia ASP.NET aplikacji mobilnych, zobacz Mobile Apps Sites with ASP.NET (Witryny usługi Mobile Apps & z 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
Wartość właściwości
Obiekt Panel reprezentujący stopkę formularza.
- Atrybuty
Przykłady
W poniższym przykładzie kodu pokazano, jak używać Footer właściwości w celu uzyskania dostępu do zawartości obiektu FooterTemplate.
Ten przykład pochodzi z większego przykładu ControlToPaginate dla właściwości .
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
W tym przykładzie, ponieważ dla elementu nie określono żadnego filtru <Choice> , zawsze będzie to SelectedChoice. Aby określić filtr, zmień element na: <Choice Filter="isPocketIE"> i dołącz plik Web.config definiujący filtry, których chcesz użyć.
<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>