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

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > WebResourceAttribute.PerformSubstitution プロパティの意味・解説 

WebResourceAttribute.PerformSubstitution プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

WebResourceAttribute クラスによって参照される埋め込みリソースの処理中に、他の Web リソース URL解析しリソースの完全パス置き換えるかどうかを示すブール値を取得または設定します

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

Public Property PerformSubstitution As
 Boolean
Dim instance As WebResourceAttribute
Dim value As Boolean

value = instance.PerformSubstitution

instance.PerformSubstitution = value
public bool PerformSubstitution { get;
 set; }
public:
property bool PerformSubstitution {
    bool get ();
    void set (bool value);
}
/** @property */
public boolean get_PerformSubstitution ()

/** @property */
public void set_PerformSubstitution (boolean
 value)
public function get PerformSubstitution
 () : boolean

public function set PerformSubstitution
 (value : boolean)

プロパティ
リソースの処理中に埋め込みリソース解決する場合trueそれ以外場合false既定値false です。

解説解説
使用例使用例

PerformSubstitution プロパティの値を照会する方法次のコード例示します。この例では、HTML ファイル Help.htm の WebResourceAttribute 属性PerformSubstitutiontrue設定されています。

このコード例は、WebResourceAttribute クラストピック取り上げているコード例一部分です。

<%@ Page Language="VB" %>
<%@ Register TagPrefix="AspNetSamples" Namespace="Samples.AspNet.VB.Controls"
 Assembly="Samples.AspNet.VB.Controls"
 %>
<%@ Import Namespace="System.Reflection"
 %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML
 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  Protected Sub Page_Load(ByVal
 sender As Object, ByVal
 e As System.EventArgs)

    ' Get the assembly metatdata.
    Dim clsType As Type = GetType(MyCustomControl)
    Dim a As Assembly =
 clsType.Assembly
    
    For Each attr As Attribute
 In Attribute.GetCustomAttributes(a)
      'Check for WebResource attributes.
      If attr.GetType() Is GetType(WebResourceAttribute)
 Then
        Dim wra As WebResourceAttribute = CType(attr,
 WebResourceAttribute)
        Response.Write("Resource in the assembly: "
 & wra.WebResource.ToString() & _
        " with ContentType = " & wra.ContentType.ToString()
 & _
        " and PerformsSubstitution = " & wra.PerformSubstitution.ToString()
 & "</br>")
      End If
    Next attr
    
    
  End Sub
  
</script>

<html  >
<head runat="server">
    <title>WebResourceAttribute Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <AspNetSamples:MyCustomControl ID="MyCustomControl1"
 runat="server">
      </AspNetSamples:MyCustomControl>    
    </div>
    </form>
</body>
</html>
<%@ Page Language="C#" %>
<%@ Register TagPrefix="AspNetSamples" Namespace="Samples.AspNet.CS.Controls"
 Assembly="Samples.AspNet.CS.Controls" %>
<%@ Import Namespace="System.Reflection" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  protected void Page_Load(object sender, EventArgs
 e)
  {
            
    // Get the assembly metatdata.
    Type clsType = typeof(MyCustomControl);
    Assembly a = clsType.Assembly;

    // Iterate through the attributes for the assembly.
    foreach (Attribute attr in Attribute.GetCustomAttributes(a))
    {
      //Check for WebResource attributes.
      if (attr.GetType() == typeof(WebResourceAttribute))
      {
        WebResourceAttribute wra = (WebResourceAttribute)attr;
        Response.Write("Resource in the assembly: "
 + wra.WebResource.ToString() +
          " with ContentType = " + wra.ContentType.ToString() +
          " and PerformsSubstitution = " + wra.PerformSubstitution.ToString()
 + "</br>");
      }
    }
  }
</script>

<html  >
<head runat="server">
    <title>WebResourceAttribute Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <AspNetSamples:MyCustomControl ID="MyCustomControl1" runat="server">
      </AspNetSamples:MyCustomControl>    
    </div>
    </form>
</body>
</html>

この例で使用できる HTML Web リソースの例を次に示しますWebResource 構文使用されていることに注意してください。これは、リソースに対して PerformSubstitution プロパティtrue設定した際に使用されます。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html >

<head>

<title>Included Help Page</title>

</head>

<body>

<div>

<img alt="help image" src=<% = WebResource("image1.jpg") %> />

Included help file.

</div>

</body>

</html>

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebResourceAttribute クラス
WebResourceAttribute メンバ
System.Web.UI 名前空間


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS