Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

Thanks,

 

Bill Yeager (MCP, BCIP)

Microsoft Certified Professional

Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer

YeagerTech Consulting, Inc.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...