TemplateControl.ParseControl メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > TemplateControl.ParseControl メソッドの意味・解説 

TemplateControl.ParseControl メソッド

入力文字列Web フォーム ページまたはユーザー コントロールControl オブジェクト解析します

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

解説解説
使用例使用例

ParseControl メソッド使用して Button Web サーバー コントロール作成しmyPlaceholder という名前の PlaceHolder Web サーバー コントロールの ControlCollection コレクションその結果追加するコード例次に示します

<%@ Page language="vb" Debug="true"
 %>
<HTML>
  <HEAD>
    <script runat="server">
    '  System.Web.UI.TemplateControl.ParseControl;
    '  The following example demonstrates the method 'ParseControl'
 of class TemplateControl.
      
    ' Since TemplateControl is abstract, this sample has been written
 using 'Page' class which derives from 
    ' 'TemplateControl' class.
    ' A button object is created by passing a string to contstruct a
 button using ASP syntax, to the 
    ' 'ParseControl' method. This button is added as one of the child
 controls of the page and displayed.

    Sub Page_Load(sender As Object,
 e As System.EventArgs)
       Dim c As Control 
       c = ParseControl("<asp:button text='Click here!' runat='server'
 />")
       myPlaceholder.Controls.Add(c)
    End Sub 'Page_Load
    </script>
  </HEAD>

  <body>
    <form runat=server>
      <asp:placeholder id = myPlaceholder runat=server />
    </form>
  </body>
</HTML>
<%@ Page language="c#" Debug="true" %>
<HTML>
  <HEAD>
    <script runat="server">
    // System.Web.UI.TemplateControl.ParserControl;
    // The following example demonstrates the method 'ParseControl'
 of class TemplateControl.
    // Since TemplateControl is abstract, this sample has been written
 using 'Page' class which derives from 
    // 'TemplateControl' class.
    // A button object is created by passing a string to contstruct
 a button using ASP syntax, to the 
    // 'ParseControl' method. This button is added as one of the child
 controls of the page and displayed.
    void Page_Load(object sender, System.EventArgs e)
    {
      Control c = ParseControl("<asp:button text='Click here!' runat='server'
 />");
      myPlaceholder.Controls.Add(c);
    }
    </script>
  </HEAD>
  <body>
    <form runat=server>
      <asp:placeholder id = myPlaceholder runat=server />
    </form>
  </body>
</HTML>
void Page_Load(Object sender, System.EventArgs e)
{
    Control c = ParseControl("<asp:button text='Click here!'"
        + " runat='server' />");
    myPlaceholder.get_Controls().Add(c);
}//Page_Load
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
TemplateControl クラス
TemplateControl メンバ
System.Web.UI 名前空間
LoadControl


このページでは「.NET Framework クラス ライブラリ リファレンス」からTemplateControl.ParseControl メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からTemplateControl.ParseControl メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からTemplateControl.ParseControl メソッド を検索

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

辞書ショートカット

すべての辞書の索引

TemplateControl.ParseControl メソッドのお隣キーワード
検索ランキング

   

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



TemplateControl.ParseControl メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS