Question

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?

Was it helpful?

Solution

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

OTHER TIPS

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?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top