TextBox.ValidationGroup 屬性

定義

取得或設定控制項群組,TextBox 控制項會在回傳至伺服器時,針對這個群組進行驗證。

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

屬性值

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

屬性

備註

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

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

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

適用於

另請參閱