PageRemoteAttribute 類別

定義

適用于 razor 頁面處理常式的 , RemoteAttributeBase 其會設定 Unobtrusive 驗證,以將 Ajax 要求傳送至網站。 叫用的處理常式應該會傳回 JSON,指出值是否有效。

public ref class PageRemoteAttribute : Microsoft::AspNetCore::Mvc::RemoteAttributeBase
[System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)]
public class PageRemoteAttribute : Microsoft.AspNetCore.Mvc.RemoteAttributeBase
[<System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)>]
type PageRemoteAttribute = class
    inherit RemoteAttributeBase
Public Class PageRemoteAttribute
Inherits RemoteAttributeBase
繼承
屬性

備註

不會對最終表單提交進行伺服器端驗證。

建構函式

PageRemoteAttribute()

適用于 razor 頁面處理常式的 , RemoteAttributeBase 其會設定 Unobtrusive 驗證,以將 Ajax 要求傳送至網站。 叫用的處理常式應該會傳回 JSON,指出值是否有效。

屬性

AdditionalFields

取得或設定用戶端應該包含在驗證要求中的逗號分隔功能變數名稱。

(繼承來源 RemoteAttributeBase)
HttpMethod

取得或設定傳送驗證要求時,用戶端應該使用 ("Get""Post") HTTP 方法。

(繼承來源 RemoteAttributeBase)
PageHandler

產生用戶端應該傳送驗證要求的 URL 時所使用的處理常式名稱。

PageName

產生用戶端應該傳送驗證要求的 URL 時所使用的頁面名稱。

RouteData

取得在 RouteValueDictionary 產生用戶端應該傳送驗證要求的 URL 時使用的 。

(繼承來源 RemoteAttributeBase)

方法

AddValidation(ClientModelValidationContext)

將 Unobtrusive 驗證 HTML 屬性新增至 ClientModelValidationContext

(繼承來源 RemoteAttributeBase)
FormatAdditionalFieldsForClientValidation(String)

格式化 propertyAdditionalFields 以用於產生的 HTML。

(繼承來源 RemoteAttributeBase)
FormatErrorMessage(String)

適用于 razor 頁面處理常式的 , RemoteAttributeBase 其會設定 Unobtrusive 驗證,以將 Ajax 要求傳送至網站。 叫用的處理常式應該會傳回 JSON,指出值是否有效。

(繼承來源 RemoteAttributeBase)
GetUrl(ClientModelValidationContext)

傳回用戶端應該傳送驗證要求的 URL。

IsValid(Object)

適用于 razor 頁面處理常式的 , RemoteAttributeBase 其會設定 Unobtrusive 驗證,以將 Ajax 要求傳送至網站。 叫用的處理常式應該會傳回 JSON,指出值是否有效。

(繼承來源 RemoteAttributeBase)

適用於