Question : ASP.Net validation controls not firing.

Hi,

I have a form with some RequiredFieldValidators that are not firing when I submit the form.
I tried adding this before the try catch statement that submits the form:

        Page.Validate()
        If Not Page.IsValid Then
            Return
        End If


..but still not firing.

The way the form is set up, it mimics multiple forms...that is, I have one section of the form in a panel, btn1 submits panel1.  Then I have another panel with more form elements and another submit button...it's in panel2 and btn2's submit that the validation fails to execute.

Was wondering if the Page.Validate() fires on panel1's submit, does it write something to viewstate that makes the page think it is still fully valid?

Thanks in advance!

Answer : ASP.Net validation controls not firing.

Nice Question!!!

I don know which version of Visual studio you are using, but its provided in VS2005 beta1, create group of controls with one submit button in it and validate only controls that are in the same group as button being clicked....It has a property called "ValidationGroup"..

You have to code a lot if you are using VS2003 as we have been doing for years.

Let me know which version of VS you are running.

REgards - MaulikCE
"Vision: the art of seeing things invisible. "




Random Solutions  
 
programming4us programming4us