Validators and inherited pages (master page)

S

Shaun

I am using a base page (I think they're also called master pages) as a
base that my webforms inherit from. The base page controls formating
and common functions used throughout the site. This all works great
until I want to use a validator.

Any validators added to the page do not fire. I can leave a required
textbox blank, and the code happily chugs through processing the
button click code.

After some research, I've found that some say this is a bug with 1.1,
where the validators do not get added back into the page.validators
collection. The solution was to do it yourself in the base page in
the init.

I've done that, and it works, but it causes another problem. My
itemCommand events for my datagrids then stop working.

Any ideas on what the heck is going on here?
 
S

Scott Allen

Hi Shaun:

I'm not sure if this is a bug or not - could you post a small code
example that demonstrates the problem?

Couple things come to mind:

Are you checking Page.IsValid in your event handler? Validators won't
stop the flow of control if the request reaches the server - you have
to check this flag. Are you using client side validation?
 

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,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top