ListControl.ValidationGroup 屬性

定義

取得或設定控制項群組,衍生自 ListControl 類別的控制項會在回傳至伺服器時,針對這個群組進行驗證。

public:
 virtual property System::String ^ ValidationGroup { System::String ^ get(); void set(System::String ^ value); };
[System.Web.UI.Themeable(false)]
public virtual string ValidationGroup { get; set; }
[<System.Web.UI.Themeable(false)>]
member this.ValidationGroup : string with get, set
Public Overridable Property ValidationGroup As String

屬性值

控制項群組,衍生的 ListControl 會在回傳至伺服器時,針對這個群組進行驗證。 預設為空字串 ("")。

屬性

備註

驗證群組可讓您將頁面上的驗證控制項指派給特定類別。 每個驗證群組都可以獨立于頁面上的其他驗證群組進行驗證。 ValidationGroup使用 屬性來指定衍生自 類別的 ListControl 控制項在回傳至伺服器時會造成驗證的驗證組名。

只有當 ValidationGroup 屬性的值 CausesValidation 設定 true 為 時,屬性才會生效。 當您指定 屬性的值 ValidationGroup 時,只有在控制項回傳至伺服器時 ListControl ,才會驗證屬於指定群組一部分的驗證控制項。 如果您未指定 屬性的值 ValidationGroup ,且 CausesValidation 屬性設定 true 為 ,則控制項回傳至伺服器時,會驗證頁面上未指派給驗證群組的所有驗證控制項。

這個屬性的值會儲存在檢視狀態中。

這個屬性無法由佈景主題或樣式表主題設定。 如需詳細資訊,請參閱 ThemeableAttributeASP.NET 主題和麵板

適用於

另請參閱