Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using ShowmessageBox with ValidationSummary field

Status
Not open for further replies.

vilrbn

Programmer
Oct 29, 2002
105
FR
Hello,

I tried to pop up a message box using a ValidationSummary field but didn't manage to.

Microsoft doc:
-------------

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.

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

My code:
--------

<asp:ValidationSummary id=&quot;Summary1&quot; runat=&quot;server&quot; ShowMessageBox=&quot;True&quot; EnableClientScript=&quot;True&quot; ShowSummary=&quot;False&quot; DisplayMode=&quot;BulletList&quot; />

It's not working !
I also set the properties in code behind, in case... no more success.

Anyone already uses this functionality ?
 
try removing EnableClientScript=True

I use this all the time without any issues...
 
I know where the problem was. In the Microsoft sample, the RequiredFieldValidator has EnableClientScript = false.
Setting it to True solves the problem.

Thanks for your help !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top