views:

56

answers:

3

We deployed our legacy ASP.NET application to production after successful test deployments to our staging environment. The application makes use of RequiredFieldValidators on one particular registration page. On our development and stage environments, the validators successfully detect empty fields when "Submit" is clicked, error messages are displayed, and form submission is prevented.

But on production, the validators do not display error messages. Clicking submit will cause a postback, the code-behind checks for Page.IsValid and correctly detects the form has missing fields, but the registration form is redisplayed with no error messages (ie "Please enter an email") to the user.

Sample: (note I dont explicitly declare EnableClientScript or SetFocusOnError)

<asp:requiredfieldvalidator id=Requiredfieldvalidator1 runat="server" CssClass="NormalRed" Display="Dynamic" ErrorMessage="Please enter an email." ControlToValidate="txtEmail"></asp:requiredfieldvalidator>

Both environments (stage and production) are identical: Win2K3 Server and IIS 7, SQL Server 2008, and ASP.NET 1.1 runtime (embarrassingly).

Any ideas?

A: 

Are you seeing any javascript errors.

Load up the page with Firebug and see if anything strange is going on.

Are you setting the validators to use a specific CSS class? Did you upload the CSS file? It is being referenced properly?

Jack Marchetti
Yes, the validators reference a specific css class, and the css file is uploaded. The css is also referenced in other pages for specific controls (texboxes mostly, not validators) and those are displaying properly, so I believe the css is ok. Having said that, I will remove the css references from the validators and redeploy to see if that helps.
Jay
+1  A: 

Are the referenced aspnet_client folders the same or are you using different versions there?

Jeroen
I will check this right now. I inherited this legacy project and soon found the previous developers didn't spend a lot of time ensuring the application code-trees were consistent between the different environments, so there's a real possibility our production environment is missing something.
Jay
Another point, this application was copied over from another hosting provider about 2 months ago. We simply copied the whole folder tree to our new server and it ran fine. I'm thinking I wont even find an aspnet_client folder due to this, but I welcome comments on this as well.
Jay
A: 

Problem was that the aspnet_client folder was missing altogether from the website tree. I copied this folder from our development environment to the root folder of our website on production, and the problem is solved. Thanks Jeroen. Thanks also to Jack Marchetti for your input.

Jay
Actually, looks like the problem is only solved in Internet Explorer. Firefox still exhibits the same problem as described.Any ideas?
Jay