EnableClientScript Property
Collapse the table of content
Expand the table of content

ValidationSummary.EnableClientScript Property

Gets or sets a value indicating whether the ValidationSummary control updates itself using client-side script.

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

Property Value

true if the ValidationSummary control updates itself using client-side script; otherwise, false. The default is true.

Remarks

Use this property to specify whether the ValidationSummary control updates itself using client-side script. When set to true, client-side script is rendered on the client to update the ValidationSummary control, if the browser supports that feature. When set to false, no client-side script is rendered on the client and the ValidationSummary control only updates itself on round-trips to the server. In this situation, the ShowMessageBox property has no effect.

Example

[Visual Basic, C#] The following example demonstrates how to use the EnableClientScript property to prevent the ValidationSummary control from using client-side script to update itself.

[Visual Basic] 

 <asp:ValidationSummary 
      id="valSum" 
      DisplayMode="BulletList"
      EnableClientScript="false"
      ShowMessageBox="false"
      ShowSummary="true" 
      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"
      EnableClientScript="false"
      ShowMessageBox="false"
      ShowSummary="true" 
      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 | ShowMessageBox

Show:
© 2016 Microsoft