Panel.Content プロパティとは? わかりやすく解説

Panel.Content プロパティ

デバイス固有のコンテンツ格納しているパネル返しますコンテンツ テンプレート定義してターゲット デバイス用に選択しておく必要があります

名前空間: System.Web.UI.MobileControls
アセンブリ: System.Web.Mobile (system.web.mobile.dll 内)
構文構文

使用例使用例

Content プロパティ使用してページ読み込み時にコントロール検索する方法次のコード例示します

メモメモ

次のコード サンプルはシングルファイル コード モデル使用しており、分離コード ファイル直接コピーされ場合正常に動作しない可能性あります。このコード サンプルは、拡張子.aspx の空のテキスト ファイルコピーする必要があります詳細については、「ASP.NET Web ページコード モデル」を参照してください

<%@ 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  >
<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 ファイルにも追加する必要があります

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

Panel.Content プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Panel.Content プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS