WebResourceAttribute.PerformSubstitution プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As WebResourceAttribute Dim value As Boolean value = instance.PerformSubstitution instance.PerformSubstitution = 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 属性の PerformSubstitution は true に設定されています。
このコード例は、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") %> />
</div>
</body>
</html>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からWebResourceAttribute.PerformSubstitution プロパティを検索する場合は、下記のリンクをクリックしてください。

- WebResourceAttribute.PerformSubstitution プロパティのページへのリンク