• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1001
  • Last Modified:

ASP.NET Client-side validation not working on one server

We are running ASP.net 2.0 on both a development machine and a production server.  The same code works fine on the development machine and the client-side validators appear as they should.  But on the production server, no client-side validation occurs.  Server-side kicks in when the page is submitted, but I'd really like the client-side to work as well.  There is no difference between the development and production configuration that I'm aware of, but I'm not exactly sure what to be looking for.  Both are using 2.0 framework and should not need the client scripts that were in aspnet_client under 1.1.  Any ideas what difference I should look for on the production machine?  Thanks!
0
jkeep
Asked:
jkeep
  • 9
  • 5
  • 4
  • +3
1 Solution
 
Elvio Lujan.Net Senior DeveloperCommented:
try to verify the .net framework is correctlly instaled on the server...
0
 
jkeepAuthor Commented:
Thank you for the reply.  I've tried to do that and everything seems fine.  I'm hoping to get some specific suggestions on what to look for or to hear from folks who may have run into this issue in the past and found a way to resolve it.  The asp.net code runs as it should (except for client-side validation).  There are several .net services running on the machine fine.  What do I look for to verify the framework is installed correctly?
0
 
Bob LearnedCommented:
1) Are you saying that development and server are running the same IIS version?

2) Do you have 1.1 installed on the server?

3) What is the setting for the web site ASP.NET target framework version on the IIS console ASP.NET tab?  

Bob
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
jkeepAuthor Commented:
1 - Actually, the production version is 6.0 because the server is Server 2003 Web Edition.  The development machine is just running Windows XP Pro with IIS 5.1.

2 - 1.1 is installed on the server and still a choice for apps.  But 2.0 is also installed and those applications are running in a different application pool.

3 - The version on the ASP.NET tab for the application is set to 2.0.50727.
0
 
Bob LearnedCommented:
4) How did you deploy the web site to the server?

5) Are there any service packs/hot fixes installed on the server?

Bob
0
 
jkeepAuthor Commented:
4 - I'm not precompiling the site right now so I just uploaded the files via FTP from my machine to the server.

5 - The server has Windows 2003 Server Web Edition Service Pack 1 installed.  Security hot fixes, routine OS stuff is handled by our host for us so I'm not sure what other hot fixes might be installed.  Is there somewhere I can easily check this if you have something in mind I should be looking for?

0
 
Bob LearnedCommented:
I have no ready solution, and this is a not an easy problem to find a solution, so we need to have as much information as possible that could help to explain where the problem lies.

Bob
0
 
Bob LearnedCommented:
6) Are you using simple custom validators, using JavaScript, or complex ones?

7) Are you getting any JavaScript errors?

Bob
0
 
jkeepAuthor Commented:
6 - We're using simple basic validators including RequiredFieldValidator and RangeValidator.  No custom validators or custom Javascript.

7 - I'm not seeing any JavaScript errors when I tab from field to field (which is when the client-side validation should kick off).  But now that I look closely, when I click the submit button a Javascript error does flash at the bottom of the page.  I was able to catch it and the error is "'WebForm_PostBackOptions' is undefined".
0
 
Bob LearnedCommented:
8) Are you using anything like this?

    PostBackOptions myPostBackOptions = new PostBackOptions(FruitRadioButtonList);

    myPostBackOptions.RequiresJavaScriptProtocol = true;
    myPostBackOptions.PerformValidation = true;
    myPostBackOptions.ValidationGroup = "PersonalInfoGroup";

    string reference = Page.ClientScript.GetPostBackEventReference(myPostBackOptions);
    FruitRadioButtonList.Attributes.Add("onclick", reference);

9) Are you using anything like Atlas, AJAX, etc. (aka non-standard libraries)?

Bob
0
 
nauman_ahmedCommented:
Are you sure you have aspnet_client folder in the root directory of server? If it is not there, copy it from c:\inetpub\wwwroot and see if it works.

--Nauman.
0
 
jkeepAuthor Commented:
8 - Nope.  I'm not doing anything with PostBackOptions.  Just using the validators out of the box and doing some enabling/disabling when certain drop-downs are chosen.

9 - The site is configured to use Atlas (web.config), but we're not using any Atlas on this page at all.  It's a very simple form.
0
 
jkeepAuthor Commented:
Nauman - The aspnet_client folder isn't required in 2.0.  2.0 serves up the appropriate Javascript libraries directly from the Assemblies when it sees a request for WebResource.axd.  But for some reason, it appears my installation/setup is not handling the request for WebResource.axd correctly.
0
 
nauman_ahmedCommented:
jkeep:

Try doing a reinstall of .NET Framework 2.0. Use a latest release from www.asp.net.

--Nauman.
0
 
nauman_ahmedCommented:
View the source of your page. Copy and paste the script source for AXD in the browser address and see what response do you get:

<script src="/mywebsite/WebResource.axd?d=2ksBEgfxgOGkIBadgQJzxw2&amp;t=632966813025255363" type="text/javascript"></script>

--Nauman.
0
 
kraffayCommented:
Did you register the ASP.NET version on the server by running aspnet_regiis.exe -i ?
0
 
jkeepAuthor Commented:
Nauman -
When I try to browse directly to the URL referenced in the HTML source, I get a 404 Page Not Found.  It seems that the http handler for the file is not actually serving it up?
0
 
jkeepAuthor Commented:
kraffay -
I had and I just reran aspnet_regiis -i to reinstall.  It made no change.
0
 
jkeepAuthor Commented:
I solved the problem.  For some reason, the mapping for .axd was not setup to point to the aspnet_isapi.dll in the IIS configuration for the app.  I added the mapping and voila!

I'm going to award the points to nauman since his suggestion of browsing for the actualy WebResource.axd file pointed me in the right direction.  Thanks for all your help guys.
0
 
nauman_ahmedCommented:
man 2.0 is fishy lol..Glad I was able to help :)

--Nauman.
0
 
GridSouthCommented:
We ran into the same issue on our production servers. After much trial and error, the issues was found to be related to ColdFusion 7 installed on the server. The fix is simple. For any IIS Web sites that are using ASP.net 2.0 and have ColdFusion 7 installed, do the following:

1.  Open IIS Manager
2. Click the Web site in question.
3. Right click and choose properties
4. Click the "Home Directory" tab
5. Click the "Configuration" button
6. On The Mappings page, you will see a section entitled "Wildcard application maps:"
7. If ColdFuson is installed, you will see something like "C:\CFusionMX7\runtime\lib\wsconfig\1\jrun_iis6_wildcard.dll"
8. Select the ColdFusion map and click the Edit button
9. Uncheck the "Verify that File Exists Box"
10. Click OK, OK, OK

Your ASP.NET application should now allow the Webresource.axd file to be created and you validations to work correctly. This solution may also work for other wildcard mappings. Copying a static webresource.axd file is not recommended.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 9
  • 5
  • 4
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now