Hello.
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.ClientScri pt.RegisterClie ntScriptBlock(t his.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.ClientScri pt.RegisterClie ntScriptInclude (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.Attribu tes.Add("onclic k", "SayHello() ");
is there supposed to be some directive in the .js file?
Any ideas? This is driving me nuts!!!
Thanks.
Matthew Wells
Matthew.Wells@F irstByte.net
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.ClientScri pt.RegisterClie ntScriptBlock(t his.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.ClientScri pt.RegisterClie ntScriptInclude (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.Attribu tes.Add("onclic k", "SayHello() ");
is there supposed to be some directive in the .js file?
Any ideas? This is driving me nuts!!!
Thanks.
Matthew Wells
Matthew.Wells@F irstByte.net
Comment