Content Property
Returns the panel containing device-specific panel content. A content template must be defined and chosen for the target device.
public System.Web.UI.MobileControls.Panel Content {
get
}
Example
The following example demonstrates how to use the Content property to find a control.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CType(panel1.Content.FindControl("Label1"), System.Web.UI.MobileControls.Label).Text = "I found this label"
End Sub
<mobile:panel id="panel1" runat="server" ForeColor="blue" Font-Italic="false">
<mobile:DeviceSpecific id="DeviceSpecific1" runat="server">
<Choice Filter="isHTML32"
Xmlns="https://schemas.microsoft.com/mobile/html32template">
<ContentTemplate>
<mobile:Label id="Label1" runat="server">Label</mobile:Label>
</ContentTemplate>
</Choice>
</mobile:DeviceSpecific>
</mobile:panel>
[C#]
void Page_Load(Object sender, EventArgs e)
{
((Label)panel.Content.FindControl("lblStatusToday")).Text
= "I found this label";
}
<mobile:panel id="panel1" runat="server" ForeColor="blue" Font-Italic="false">
<mobile:DeviceSpecific id="DeviceSpecific1" runat="server">
<Choice Filter="isHTML32"
Xmlns="https://schemas.microsoft.com/mobile/html32template">
<ContentTemplate>
<mobile:Label id="Label1" runat="server">Label</mobile:Label>
</ContentTemplate>
</Choice>
</mobile:DeviceSpecific>
</mobile:panel>