TagPrefixCollection クラスとは? わかりやすく解説

TagPrefixCollection クラス

メモ : このクラスは、.NET Framework version 2.0新しく追加されたものです。

TagPrefixInfo オブジェクトコレクション格納します

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

Public NotInheritable Class
 TagPrefixCollection
    Inherits ConfigurationElementCollection
Dim instance As TagPrefixCollection
public sealed class TagPrefixCollection : ConfigurationElementCollection
public ref class TagPrefixCollection sealed
 : public ConfigurationElementCollection
public final class TagPrefixCollection extends
 ConfigurationElementCollection
public final class TagPrefixCollection extends
 ConfigurationElementCollection
解説解説
使用例使用例

以下は構成ファイルからの抜粋です。TagPrefixCollection 型の複数プロパティに対して宣言によって値を指定する方法示してます。

<system.web>
  <pages>
    <controls>
      <clear />
      <remove tagPrefix="MyTags" />
      <!—- Searches all linked assemblies for the namespace -->
      <add tagPrefix="MyTags1" namespace=" MyNameSpace "/>
      <!-- Uses a specified assembly -->
      <add tagPrefix="MyTags2" namespace="MyNameSpace" 
        assembly="MyAssembly"/>
      <!-- Uses the specified source for the user control -->
      <add tagprefix="MyTags3" tagname="MyCtrl" src="https://weblio.hs.llnwd.net/e7/img/dict/msdnc/MyControl.ascx"/>
    </controls>
   </pages>
</system.web>

TagPrefixCollection クラス使用してプログラムかタグ プレフィックス設定変更する方法次のコード例示します。このコード例は、PagesSection クラストピック取り上げているコード例一部分です。

' Get all current Controls in the collection.
Dim j As Int32
For j = 0 To pagesSection.Controls.Count -
 1
  Console.WriteLine("Control {0}:", j)
  Console.WriteLine("  TagPrefix = '{0}' ", _
   pagesSection.Controls(j).TagPrefix)
  Console.WriteLine("  TagName = '{0}' ", _
   pagesSection.Controls(j).TagName)
  Console.WriteLine("  Source = '{0}' ", _
   pagesSection.Controls(j).Source)
  Console.WriteLine("  Namespace = '{0}' ",
 _
   pagesSection.Controls(j).Namespace)
  Console.WriteLine("  Assembly = '{0}' ",
 _
   pagesSection.Controls(j).Assembly)
Next

' Create a new TagPrefixInfo object.
Dim tagPrefixInfo As System.Web.Configuration.TagPrefixInfo
 = _
 New System.Web.Configuration.TagPrefixInfo("MyCtrl",
 "MyNameSpace", "MyAssembly",
 "MyControl", "MyControl.ascx")

' Execute the Add Method.
pagesSection.Controls.Add(tagPrefixInfo)

' Add a TagPrefixInfo object using a constructor.
pagesSection.Controls.Add( _
 New System.Web.Configuration.TagPrefixInfo( _
 "MyCtrl", "MyNameSpace",
 "MyAssembly", "MyControl",
 _
 "MyControl.ascx"))
// Get all current Controls in the collection.
for (int i = 0; i < pagesSection.Controls.Count;
 i++)
{
  Console.WriteLine("Control {0}:", i);
  Console.WriteLine("  TagPrefix = '{0}' ",
      pagesSection.Controls[i].TagPrefix);
  Console.WriteLine("  TagName = '{0}' ",
      pagesSection.Controls[i].TagName);
  Console.WriteLine("  Source = '{0}' ",
      pagesSection.Controls[i].Source);
  Console.WriteLine("  Namespace = '{0}' ",
      pagesSection.Controls[i].Namespace);
  Console.WriteLine("  Assembly = '{0}' ",
      pagesSection.Controls[i].Assembly);
}

// Create a new TagPrefixInfo object.
System.Web.Configuration.TagPrefixInfo tagPrefixInfo =
    new System.Web.Configuration.TagPrefixInfo("MyCtrl",
 "MyNameSpace", "MyAssembly", "MyControl", "MyControl.ascx");

// Execute the Add Method.
pagesSection.Controls.Add(tagPrefixInfo);

// Add a TagPrefixInfo object using a constructor.
pagesSection.Controls.Add(
    new System.Web.Configuration.TagPrefixInfo(
    "MyCtrl", "MyNameSpace", "MyAssembly", "MyControl"
,
    "MyControl.ascx"));
継承階層継承階層
System.Object
   System.Configuration.ConfigurationElement
     System.Configuration.ConfigurationElementCollection
      System.Web.Configuration.TagPrefixCollection
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「TagPrefixCollection クラス」の関連用語

TagPrefixCollection クラスのお隣キーワード
検索ランキング

   

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



TagPrefixCollection クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS