ValidationSummary issue

  • Thread starter Thread starter Hardy Wang
  • Start date Start date
H

Hardy Wang

Hi,
I have some validations on a page, some of them are CustomValidation
which will go to server to do some complex logic.
I set the ValidationSummary.ShowMessageBox = true, but message box won't
popup. After I do a research over net, I found it is a bug from MS. Anybody
has good work-around? I know I can loop through each validation control to
check statuses of them, then build a JavaScript to register on client side.
Any better idea?


Thanks!
 
I don't know if it's a bug of .Net Framework, but I found a work-around:
Just add following Javascript in the buttom of the .aspx page.
<script LANGUAGE="Javascript">
<!--
ValidationSummaryOnSubmit();
//-->
</script>

Let me know if it does solve this issue.
 
Here is a work-around.
Add following JavaScript in the bottom of the html tag.
<Script Language=JavaScript>
<!--
ValidationSummaryOnSubmit();
//-->
</Script

User submitted from AEWNET (http://www.aewnet.com/)
 
Since the ValidationSummaryOnSubmit() is a built-in function from the
WebUIValidation.js
The system should place the Javascript block automatically based on which
version .Net Framework
was registered and mapped to IIS, if not, the browser will pop up a window
to show following message:
Unable to find script library
'/aspnet_client/system_web/1_1_4322/WebUIValidation.js'. Try placing this
file manually, or reinstall by running 'aspnet_regiis -c'.
 
A workaround that does seem to be effective is to place the following code
inside the form tag:

<script language="javascript" type="text/javascript"
src="/aspnet_client/system_web/1_1_4322/WebUIValidation.js"></script>

The problem with this solution is that the version is hard-coded.
 
Hardy said:
*Hi,
I have some validations on a page, some of them are CustomValidation
which will go to server to do some complex logic.
I set the ValidationSummary.ShowMessageBox = true, but message box
won't
popup. After I do a research over net, I found it is a bug from MS.
Anybody
has good work-around? I know I can loop through each validation
control to
check statuses of them, then build a JavaScript to register on client
side.
Any better idea?


Thanks!
 
Back
Top