This documentation is archived and is not being maintained.

ValidationSummary.ShowMessageBox Property

Gets or sets a value indicating whether the validation summary is displayed in a message box.

[Visual Basic]
Public Property ShowMessageBox As Boolean
[C#]
public bool ShowMessageBox {get; set;}
[C++]
public: __property bool get_ShowMessageBox();
public: __property void set_ShowMessageBox(bool);
[JScript]
public function get ShowMessageBox() : Boolean;
public function set ShowMessageBox(Boolean);

Property Value

true if the validation summary is to be displayed in a message box; otherwise, false. The default is false.

Remarks

This property can be used in addition to the ShowSummary property to control where the validation summary is displayed. If this property and EnableClientScript are both set to true, the validation summary is displayed in a message box. If EnableClientScript is set to false, this property has no effect.

Note   If both the ShowMessageBox and ShowSummary properties are set to true, the validation summary is displayed in both a message box and on the Web page.

Example

[Visual Basic, C#] The following example demonstrates how to use the ShowMessageBox and ShowSummary properties to specify that the validation summary is only displayed in a message box.

[Visual Basic] 

 <asp:ValidationSummary 
      id="valSum" 
      DisplayMode="BulletList"
      ShowMessageBox="true"
      ShowSummary="false" 
      HeaderText="You must enter a value in the following fields:"
      Font-Name="verdana" 
      Font-Size="12"
      runat="server"/>
    

[C#] 

 <asp:ValidationSummary 
      id="valSum" 
      DisplayMode="BulletList"
      ShowMessageBox="true"
      ShowSummary="false" 
      HeaderText="You must enter a value in the following fields:"
      Font-Name="verdana" 
      Font-Size="12"
      runat="server"/>
    

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

ValidationSummary Class | ValidationSummary Members | System.Web.UI.WebControls Namespace | ShowSummary | EnableClientScript

Show: