Panel.Content 속성

정의

디바이스별 내용이 포함된 패널을 반환합니다. 대상 디바이스에 대해 내용 템플릿을 정의하고 선택해야 합니다. 이 API는 더 이상 사용되지 않습니다. ASP.NET 모바일 애플리케이션을 개발하는 방법에 대한 자세한 내용은 ASP.NET 있는 Mobile Apps & 사이트를 참조하세요.

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

속성 값

디바이스별 패널 내용이 포함된 패널입니다.

특성

예제

다음 코드 예제를 사용 하는 방법에 설명 합니다 Content 페이지가 로드 될 때 컨트롤을 찾을 속성입니다.

참고

다음 코드 샘플 단일 파일 코드 모델을 사용 하 고 코드 숨김 파일에 직접 복사 하는 경우 제대로 작동 하지 않을 수 있습니다. 이 코드 샘플.aspx 확장명이 있는 빈 텍스트 파일에 복사 해야 합니다. 자세한 내용은 ASP.NET Web Forms 페이지 코드 모델합니다.

<%@ Page Language="C#" 
    Inherits="System.Web.UI.MobileControls.MobilePage" %>
<%@ Register TagPrefix="mobile" 
    Namespace="System.Web.UI.MobileControls" 
    Assembly="System.Web.Mobile" %>
<%@ Import Namespace="System.Drawing" %>

<script runat="server">
    public void Page_Load(Object sender, EventArgs e)
    {
        // Set Panel1 properties
        Panel1.Wrapping = Wrapping.NoWrap;
        Panel1.Alignment = Alignment.Center;
        Panel1.StyleReference = "title";

        // Find Label in Panel2
        Control ctl = Panel2.Content.FindControl("lblStatusToday");
        if (ctl != null)
            ((System.Web.UI.MobileControls.Label)ctl).Text
                = "I found this label";
    }
    
    public void MakeFontRed(Object sender, EventArgs e)
    {
        Panel1.ForeColor = Color.Red;
    }
    
    public void MakeFontBlue(Object sender, EventArgs e)
    {
        Panel1.ForeColor = Color.Blue;
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
<mobile:Form runat="server" id="Form1">
    <!-- First Panel -->
    <mobile:Panel runat="server" id="Panel1">
        <mobile:TextView runat="server" id="TextView1">
            A Panel provides a grouping mechanism<br />
            for organizing controls.
        </mobile:TextView>
    </mobile:Panel>
    <mobile:Command runat="server" id="Command1"  BreakAfter="false"
        Text="Make Font Red" OnClick="MakeFontRed"/>
    <mobile:Command runat="server" id="Command2" BreakAfter="true"
        Text="Make Font Blue" OnClick="MakeFontBlue"/>

    <!-- Second Panel -->
    <mobile:Panel ID="Panel2"  Runat="server">
        <mobile:DeviceSpecific id="DeviceSpecific1" runat="server">
            <!-- Filter and template for HTML32 devices -->
            <Choice Filter="isHTML32" 
                Xmlns="http://schemas.microsoft.com/mobile/html32template">
                <ContentTemplate>
                    <mobile:Label id="Label1" runat="server">
                        HTML32 Template</mobile:Label>
                    <mobile:Label ID="lblStatusToday" Runat="server"/>
                </ContentTemplate>
            </Choice>
            <!-- Default filter and template -->
            <Choice>
                <ContentTemplate>
                    <mobile:Label ID="Label1" Runat="server">
                        Default Template</mobile:Label>
                    <mobile:Label ID="lblStatusToday" Runat="server" />
                </ContentTemplate>
            </Choice>
        </mobile:DeviceSpecific>
    </mobile:Panel>
</mobile:Form>
</body>
</html>

이 섹션에서는 Web.config 파일에 추가 해야 합니다.

적용 대상

추가 정보