Dela via


JSInvokableAttribute Class

Definition

Identifies a .NET method as allowing invocation from JavaScript code. Any method marked with this attribute may receive arbitrary parameter values from untrusted callers. All inputs should be validated carefully.

public ref class JSInvokableAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=true)]
public sealed class JSInvokableAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=true)>]
type JSInvokableAttribute = class
    inherit Attribute
Public NotInheritable Class JSInvokableAttribute
Inherits Attribute
Inheritance
JSInvokableAttribute
Attributes

Constructors

JSInvokableAttribute()

Constructs an instance of JSInvokableAttribute without setting an identifier for the method.

JSInvokableAttribute(String)

Constructs an instance of JSInvokableAttribute using the specified identifier.

Properties

Identifier

Gets the identifier for the method. The identifier must be unique within the scope of an assembly.

If not set, the identifier is taken from the name of the method. In this case the method name must be unique within the assembly.

Applies to