.Net ramblings
# Friday, 17 December 2004
[FIX] aspx validation not working + buttons not clicking

when i deployed my web app to the production server, i found that none of the client-side validation was working. 

the first problem was that there was no mime-type set up on the server for .js files, so i added "application/x-javascript" for the .js extension.

the next problem was that the script references in my aspx pages did not match the script location on the server.   the html source of one of my pages had the webuivalidation.js path set to /aspnet_client/system_web/1_1_4322/WebUIValidation.js

but the server directory was "/aspnet_client/system_web/1_1_4322_0/WebUIValidation.js"

so i tried duplicating the directory so that i would have both paths on the server, but that caused strange problems on the aspx page, such as buttons not clicking (when the event handlers are definitely registered). 

so what i did was run aspnet_regiis -i on the server to make sure all the script maps are registered properly, and it worked. 

if you don't have control over the web server, you can add the following to your web.config

  <webControls clientScriptsLocation="/aspnet_client/system_web/1_1_4322_0/" />

Friday, 17 December 2004 12:46:46 (GMT Standard Time, UTC+00:00)  #    Comments [1]  Asp.Net

Friday, 08 September 2006 17:48:53 (GMT Daylight Time, UTC+01:00)
Thanks for the web.config workaround tip, I was just experiencing such problem with a web server that I don't have control
Juan Barrios
Please login with either your OpenID above, or your details below.
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

[Captcha]Enter the code shown (prevents robots):

Live Comment Preview