try moving the function to your current file and see if it fixes your problem. Also, make sure your file is included before you call the function.
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
This is because you are compiling your page before the javascript runs. Try adding the javascript to your page before you call your code. Example is below:
If Not Page.IsPostBack Then
If Not Page.IsClientScriptBlockRegistered("IncludedJavascript") Then
Page.RegisterClientScriptBlock("IncludedJavascript", "<SCRIPT Language=""JavaScript"" src=""javascriptincludedfile.js""></SCRIPT>")
End If
ddlid.Attributes.Add("onchange","javascript:callfunction(this);")
End If
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
first check to see if your code is executing correctly. add a write command right after your scriptcode src segment and run the page. If it posts, and your script isn't executing let me know.
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68
then I guess the only thing I can suggest to you is put your code on that page instead of in the include file. I've had that problem before and that was the way I solved it. Sorry that I can't be of more assistance. Try the javascript forum as well!
SheSaidImaPregy
Veteran Poster
1,080 posts since Sep 2007
Reputation Points: 43
Solved Threads: 68