WebResourceAttribute(String, String) Constructor

Definition

Initializes a new instance of the WebResourceAttribute class with the specified Web resource and resource content type.

C#
public WebResourceAttribute(string webResource, string contentType);

Parameters

webResource
String

The name of the of Web resource.

contentType
String

The type of resource, such as "image/gif" or "text/javascript".

Exceptions

webResource is null or an empty string ("").

-or-

contentType is null or an empty string ("").

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1