Defines the metadata attribute that enables an embedded resource in an assembly. This class cannot be inherited.
Assembly: System.Web (in System.Web.dll)
Thetype exposes the following members.
|CdnPath||Gets or set the path of a Content Delivery Network (CDN) that contains Web resources.|
|CdnSupportsSecureConnection||Gets or set a value that indicates to the ScriptManager whether a script resource should be accessed using a secure connection to the content delivery network (CDN) path when the page is accessed using HTTPS.|
|ContentType||Gets a string containing the MIME type of the resource that is referenced by the class.|
|LoadSuccessExpression||Gets or sets an expression that is used when a Web resource has successfully loaded.|
|PerformSubstitution||Gets or sets a Boolean value that determines whether, during processing of the embedded resource referenced by the class, other Web resource URLs are parsed and replaced with the full path to the resource.|
|TypeId||When implemented in a derived class, gets a unique identifier for this Attribute. (Inherited from Attribute.)|
|WebResource||Gets a string containing the name of the resource that is referenced by the class.|
|Equals||Infrastructure. Returns a value that indicates whether this instance is equal to a specified object. (Inherited from Attribute.)|
|GetHashCode||Returns the hash code for this instance. (Inherited from Attribute.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|IsDefaultAttribute||When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. (Inherited from Attribute.)|
|Match||When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Inherited from Attribute.)|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
|_Attribute.GetIDsOfNames||Maps a set of names to a corresponding set of dispatch identifiers. (Inherited from Attribute.)|
|_Attribute.GetTypeInfo||Retrieves the type information for an object, which can be used to get the type information for an interface. (Inherited from Attribute.)|
|_Attribute.GetTypeInfoCount||Retrieves the number of type information interfaces that an object provides (either 0 or 1). (Inherited from Attribute.)|
|_Attribute.Invoke||Provides access to properties and methods exposed by an object. (Inherited from Attribute.)|
The class is valid only when used on assembly declarations. It is used to enable a specified embedded resource in an assembly for use as a Web resource.
For more information on resources, see ASP.NET Web Page Resources Overview.
This section contains two code examples. The first code example demonstrates how to apply the attribute to a namespace that defines a custom control, MyCustomControl. The second code example demonstrates how to use the MyCustomControl class in a Web page.
The following code example demonstrates how to apply the attribute on a custom assembly to define an image Web resource and an HTML Web resource. The MyCustomControl class defines a composite control that uses the resources to set the value of the ImageUrl property of an Image control that is contained within the composite control and to set the HRef property of an HtmlAnchor control linking to the HTML resource.
The following code example demonstrates how to use the MyCustomControl class in a Web page.
This example requires that you compile the Image1.jpg and Help.htm resources with the assembly that contains MyCustomControl. For more information, see, /resource (C# Compiler Options) or /resource (Visual Basic).
An example of an HTML Web resource that could be used in this example is shown next. Note the use of the WebResource syntax, which is used when you set the PerformSubstitution property to true for a Web resource.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<title>Included Help Page</title>
<img alt="help image" src=<% = WebResource("image1.jpg") %> />
Included help file.