Home All Groups Group Topic Archive Search About

Server Side Custom Validation not running

Author
16 Feb 2006 4:21 PM
robin9876
In an ASP.Net 1.1 web page I have added a custom control, that has no
client side validation but has server side validation. I have set the
property of the custom validation to have onServerValidate =
"CustomValidator_ServerValidate"
The server validation code is in the function defined as Public Sub
CustomValidator_ServerValidate(ByVal source As System.Object, ByVal
args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles
CustomValidator.ServerValidate

When running the form and submitting the the data which should then use
server validation the function is not being run. Are any other settings
required to be set to allow the function to run on the server side?

Author
16 Feb 2006 4:30 PM
Kris
Hello Robin,

Refer to the following link for the CustomValidator and Server
validation.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskvalidatingwithcustomfunction.asp

Cheers,
Kris
Author
17 Feb 2006 12:02 PM
robin9876
This works in a new web page but does not work in an existing page that
I need to add the validation to.
In the existing page it does not run the validate event but there are
other validations on the form which are working including custom
validation controls. There are no other validation controls that are
validating this particular text box item.

Is there any other settings that I could verify/investigate to see why
the validate event is not being run?
Author
17 Feb 2006 12:25 PM
Kris
Hi,

Set ValidateRequest = "true" in your web page.

Cheers,
Kris
Author
17 Feb 2006 2:17 PM
robin9876
I have added it to the page declarations for the web page and it still
is not running the validatation.
Author
17 Feb 2006 2:52 PM
Kris
Hi,

If it is not working even after ValidateRequest = "true" in page
directive, compare the new web page which is working and your old page
using Windiff or VSS. And check what you are missing.

Cheers,
Kris
Author
21 Feb 2006 11:47 AM
robin9876
Is there a limit to the number of controls or lines of code in a single
Asp.Net page? As the only thing that I can see difference is the size
of the form.
Author
22 Feb 2006 2:02 PM
robin9876
I was able to get the page to work by not specifying the control to
validate and adding a page.validate on the form submit button.

Thanks for the help.