wsyeager Posted December 27, 2004 Posted December 27, 2004 I'm registering a startup script in my "page load" event. Everything works fine when I run it locally, but when it's deployed to the webserver, it doesn't execute the javascript which is inside a ".js" file (on the root directory of the website). Here is the HTML where I have the javascript function to execute: <code> <TD style="HEIGHT: 23px"> <input name="txtEnding" type="text" value="100" id="txtEnding" tabindex="24" onChange="CalculateTotalMileage();" style="width:96px;" /></TD> </code> Here is the code in my code behind page: <code> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load RegisterScripts() . . . Private Sub RegisterScripts() txtMileageBeginning.Attributes.Add("onChange", "CalculateTotalMileage();") txtEnding.Attributes.Add("onChange", "CalculateTotalMileage();") ddlDispatchInfo.Attributes.Add("onChange", "EnableDispatchInfoOther();") If (Not IsClientScriptBlockRegistered("PageStartupJScript")) Then RegisterClientScriptBlock("PageStartupJScript", "<script language=""javascript"" src=""/EMSAssist/ClientFunctions.js""></script>") End If End Sub </code> Why isn't the web application recognizing the javascript functions when it's deployed to the webserver? Quote Thanks, Bill Yeager (MCP, BCIP) Microsoft Certified Professional Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer YeagerTech Consulting, Inc.
Moderators Robby Posted December 28, 2004 Moderators Posted December 28, 2004 Are sure that the path to the js file is correct and that you have access to it? Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.