Solved

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

Posted on 2006-11-13
21
954 Views
Last Modified: 2008-02-26
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
Comment
Question by:jkeep
  • 9
  • 5
  • 4
  • +3
21 Comments
 
LVL 17

Expert Comment

by:lem2802
ID: 17929682
try to verify the .net framework is correctlly instaled on the server...
0
 

Author Comment

by:jkeep
ID: 17929792
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
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17930210
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
 

Author Comment

by:jkeep
ID: 17930276
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
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17930292
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
 

Author Comment

by:jkeep
ID: 17930410
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
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17930430
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
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17930455
6) Are you using simple custom validators, using JavaScript, or complex ones?

7) Are you getting any JavaScript errors?

Bob
0
 

Author Comment

by:jkeep
ID: 17930508
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
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17930570
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 25

Expert Comment

by:nauman_ahmed
ID: 17930603
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
 

Author Comment

by:jkeep
ID: 17930629
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
 

Author Comment

by:jkeep
ID: 17930657
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
 
LVL 25

Expert Comment

by:nauman_ahmed
ID: 17930796
jkeep:

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

--Nauman.
0
 
LVL 25

Accepted Solution

by:
nauman_ahmed earned 125 total points
ID: 17930881
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
 
LVL 9

Expert Comment

by:kraffay
ID: 17931162
Did you register the ASP.NET version on the server by running aspnet_regiis.exe -i ?
0
 

Author Comment

by:jkeep
ID: 17931378
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
 

Author Comment

by:jkeep
ID: 17931388
kraffay -
I had and I just reran aspnet_regiis -i to reinstall.  It made no change.
0
 

Author Comment

by:jkeep
ID: 17931457
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
 
LVL 25

Expert Comment

by:nauman_ahmed
ID: 17931505
man 2.0 is fishy lol..Glad I was able to help :)

--Nauman.
0
 
LVL 1

Expert Comment

by:GridSouth
ID: 20352939
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

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now