RequiredFieldValidator

G

Guest

Hi,

Is it possible to use a RequiredFieldValidator at runtime. I have tried and
it apears to ignore the field to valdate propertie

Jim
 
G

gabe garza

One reason could be that the browser wasn't able to load the client
validation JavaScript code. (WebUIValidation.js)

The following gets inserted into your web page when you use a validation
control. Notice the check for Page_ValidationVer.
If WebUIValidation.js didn't get loaded, Page_ValidationVer will be
undefined. Page_ValidationVer is the first definition in WebUIValidation.js

<script language="javascript" type="text/javascript">
<!--
var Page_ValidationActive = false;
if (typeof(clientInformation) != "undefined" &&
clientInformation.appName.indexOf("Explorer") != -1) {
if ((typeof(Page_ValidationVer) != "undefined") && (Page_ValidationVer
== "125"))
ValidatorOnLoad();
}

function ValidatorOnSubmit() {
if (Page_ValidationActive) {
return ValidatorCommonOnSubmit();
}
return true;
}
// -->
</script>

This next line should be in your web page as well. This again is inserted
once you use a validation control.
<script language="javascript" type="text/javascript"
src="/aspnet_client/system_web/1_1_4322/WebUIValidation.js"></script>

You can still validate on the server as well. Something we have to do here
since alot of our users are Mac based, if they're not running IE. (Safari or
Firefox).

if false = Page.IsValid Then
Validate()
End If

If true = Page.IsValid Then
' continue with your code
End If
 
G

Guest

Hi Gabe,

Thanks for the tip but it did not work either. What I am doing is putting
controls and validators on the page at runtime in code. it appears to be fine
when looking at source but nothing is validated. Using the if statement makes
it not throw an error so but the Validate() function does nothing?

Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top