.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

<system.web>
  <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