Problem calling function

X

Xerxes

Hi,
I have an aspx page that uses a master page. In the master page, I
added a reference to a javascript file.
When in the aspx page I try to call a function located in the
javascript file, I keep getting error that function is undefined.

In Master Page I have:
<body class="center">
<script type="text/javascript" src="../assets/scripts/
wz_tooltip.js"></script>
<form id="MainForm" runat="server">
....
</form>
</body>

In the aspx file:

<script type="text/javascript">
function doTip(name) {
var msg = "Edit " + name + " Properties";
Tip(msg); <----- This function is defined in the
javascript file, causes error
}
</script>
.......
<a href="..." onmouseover="doTip('some_value')">blah</a>
 
X

Xerxes

Hi,
I have an aspx page that uses a master page. In the master page, I
added a reference to a javascript file.
When in the aspx page I try to call a function located in the
javascript file, I keep getting error that function is undefined.

In Master Page I have:
<body class="center">
    <script type="text/javascript" src="../assets/scripts/
wz_tooltip.js"></script>
    <form id="MainForm" runat="server">
    ....
    </form>
</body>

In the aspx file:

<script type="text/javascript">
        function doTip(name) {
            var msg = "Edit " + name + " Properties";
            Tip(msg);    <----- This function is defined in the
javascript file, causes error
        }
</script>
......
<a href="..." onmouseover="doTip('some_value')">blah</a>

I will try to figure this out. When I moved the reference from master
page to the aspx page itself, it works fine. It is odd that when I do
a "View SOurce", all looks good.
 
E

Evertjan.

Xerxes wrote on 26 jun 2009 in comp.lang.javascript:
Hi,
I have an aspx page that uses a master page. In the master page, I
added a reference to a javascript file.
When in the aspx page I try to call a function located in the
javascript file, I keep getting error that function is undefined.

In Master Page I have:
<body class="center">
<script type="text/javascript" src="../assets/scripts/
wz_tooltip.js"></script>
<form id="MainForm" runat="server">
....
</form>
</body>

In the aspx file:

<script type="text/javascript">
function doTip(name) {
var msg = "Edit " + name + " Properties";
Tip(msg); <----- This function is defined in the
javascript file, causes error
}
</script>
......
<a href="..." onmouseover="doTip('some_value')">blah</a>

<form id="MainForm" runat="server">

Strange, a form running on the server!

Better ask this in:

neas:microsoft.public.dotnet.framework.aspnet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top