B
bill yeager
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?
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?