JSInvokableAttribute 類別

定義

將 .NET 方法識別為允許從 JavaScript 程式碼叫用。 任何以此屬性標示的方法,都可能會從不受信任的呼叫端接收任意參數值。 所有輸入都應該仔細驗證。

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
繼承
JSInvokableAttribute
屬性

建構函式

JSInvokableAttribute()

建構 的 JSInvokableAttribute 實例,而不設定 方法的識別碼。

JSInvokableAttribute(String)

使用指定的識別碼建構 的 JSInvokableAttribute 實例。

屬性

Identifier

取得 方法的識別碼。 識別碼在元件的範圍內必須是唯一的。

如果未設定,則會從方法的名稱取得識別碼。 在此情況下,方法名稱在元件內必須是唯一的。

適用於