Cannot call external javascript function from SITE.MASTER

Posted by WOPR on Stack Overflow See other posts from Stack Overflow or by WOPR
Published on 2010-03-31T05:05:53Z Indexed on 2010/03/31 5:13 UTC
Read the original article Hit count: 293

Filed under:
|

I have a Site.Master in my ASP.NET project which defines a HEAD section as follows

<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title id="MasterTitle">MyApp</title>
    <link rel="icon" href="Content/icon.ico" type="image/x-icon" />
    <link href="Content/mycss.css" rel="stylesheet" type="text/css" />
    <script src="Content/mycode.js" type="text/javascript"></script>
</head>

In the mycode.js file, I have a function called GetSels();

function GetSels()
{
//do stuff
}

If the GetSels function is defined in Site.Master, GetSels is callable. If it's in mycode.js, it's not.

Every code example I've see seems to says this should work.

What am I doing wrong?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about JavaScript