M
Matthew Wells
Hello. This is a repost because nothing has worked so far.
I thought this was supposed to be simple. I'm trying to use a .js file for
my javascript functions. I'm testing by only using one function The
function works when it's at the top of my aspx file.
The file is called "MyFunctions.js" which was imported on the page load
event of the code-behind form with:
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyFuncs",
"MyFunctions.js", true); - I've used this with both true and false and with
adding script tags myself in the .js file.
I've also tried
Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "MyFuncs",
"MyFunctions.js");
The .js file is in the same directory as the page. and has only one
function:
function SayHello()
{
alert("Hello");
}
I added the function call on the code behind page load
btnLast.Attributes.Add("onclick", "SayHello()");
is there supposed to be some directive in the .js file?
I've also tried just directly referencing the file in the aspx file with:
<script type="text/javascript" src="MyFunctions.js"></script>
Still no luck.
Any ideas? This is STILL driving me nuts!!!
Thanks.
Matthew Wells
(e-mail address removed)
I thought this was supposed to be simple. I'm trying to use a .js file for
my javascript functions. I'm testing by only using one function The
function works when it's at the top of my aspx file.
The file is called "MyFunctions.js" which was imported on the page load
event of the code-behind form with:
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "MyFuncs",
"MyFunctions.js", true); - I've used this with both true and false and with
adding script tags myself in the .js file.
I've also tried
Page.ClientScript.RegisterClientScriptInclude(this.GetType(), "MyFuncs",
"MyFunctions.js");
The .js file is in the same directory as the page. and has only one
function:
function SayHello()
{
alert("Hello");
}
I added the function call on the code behind page load
btnLast.Attributes.Add("onclick", "SayHello()");
is there supposed to be some directive in the .js file?
I've also tried just directly referencing the file in the aspx file with:
<script type="text/javascript" src="MyFunctions.js"></script>
Still no luck.
Any ideas? This is STILL driving me nuts!!!
Thanks.
Matthew Wells
(e-mail address removed)