Server side validations not firing

I have an asp.net 2.0 website which works great on the local machine in visual studio 2008.
but when i (deploy, publish, copy) it on the server the validations don't fire in some cases.
We are using IIS 6 and windows server 2003. Can anyone offer any ideas about why this would be the case or where to begin looking for the root cause?

I have programmers who know .Net and I have network guys who know IIS, MS Exchange, etc. but neither know a lot about the intricacies of deploying web sites. This is very, very bad! Any help would be greatly appreciated.

i've worked with both (network and .net framework)... so i probably have a fix for your issue. However, i'd need to know what you mean by "not firing" ? is it the field validators? or the me.IsValid or what? i don't understand what you mean by server-side validations don't fire in some cases?

from what i assume, it's probably not a server setting issue, but a code issue...

thx.

0

ksniderAuthor Commented: 2009-04-04

I mean to say required field validator and regular expression validator are not firing on deployed website but firing on website running from local iis and VS development server

No All these validations are in user controls ,I have several user controls but some user controls works properly but some not. I think they shoud be an isssue with IIS setup in developemnt server where client side validations are not enabled using aspnet_regiis -ea or some thing like that.what you say

Add thie in server side code
Page.Isvalid() in form load this will make all the validation controls work

if (!Page.IsValid) {
return;
}
else
{
do your regular process....
}

0

ksniderAuthor Commented: 2009-04-04

Dear mahadevan_v: Thanks for this. It is a good band-aid but does not solve the problem. BTW, it didn't work on form load. We had to put it on button click. But the ASP validation control should work without this work-around. It works fine on other pages, just not in all. In fact, there are places where we repurpose the exact same code (Investor Briefing Registration and Pilot Briefing Registration, for example) and in works in one case and not the other. Here is a code snippet. Maybe that will help us solve this mystery? Thanks in advance for any additional guidance.

also, after looking at your code above, what part doesn't work? everything? or just the text shows and not the image?

0

ksniderAuthor Commented: 2009-04-05

Max- The page renders as it should and it writes the form data tot he database properly. What doesn't work is the validation control. So, basically, wherever it says Required Field Validator or Expression Validator - those are the things that do not work.

The issue isn't browsers. It works when loaded on our development server but not on the main servers. And what is weird is, the same controls will work on certain pages on the main server but not on others. Acts the same in all browsers. It is server specific.

We have three servers - one is the desktop "server" created by Visual Studio. Works perfectly there - on every single page. Then we have two real servers running IIS 6. Acts identical on both. Some pages work and some don't and it is the same pages on both.

Hope that explains it more fully.

BTW, the workaround Mahadevan gave above does work. When we added that to the validation controls, they all work. So that should be worth some partial points. The thing is, we shouldn't have to do that. Why does it work without that in some places and no in others.

Yes, I know what field validators are thanks ;) what I was asking is the following: does the "faulty" validators display partial information (just the text but not the image) or simply don't work at all?

As for the IsValid points, if you look at my first post, I include it, saying that the only way to be sure all field validators work is to fire the IsValid command. But no matter. To explain that comment:
IsValid command fires all field validators one by one, and validates them server-side, NOT client side. This ensures that no matter what settings are enabled on browsers, the validators will fire. You can also do them one by one if required. Fieldvalidatorname.isvalid.

In any case, from what you've said, and from having the isvalid fix it, that was your problem originally. You were not validating server-side.

Best practice is always to have the isvalid fire on the save command or button, and not to rely on the OnBlur events (which are client-side).

Cheers

M

0

ksniderAuthor Commented: 2009-04-06

Sorry - too many hours with too little sleep! I am with you now. The question about the images threw me. I wasn't thinking of the asterisk images that went with the text. Thanks for your help.