Hi,
I was playing around with some javascript earlier, I got everything working in a test page and then put it into the page it needs to be in which happens to have a master page.
If I give 2 really basic pages, the first is a non-master page which the javascript correctly fires from:
The second has a master page and the javascript does not fire:
Can somebody tell me where I am going wrong?
Thanks, Dave.
I was playing around with some javascript earlier, I got everything working in a test page and then put it into the page it needs to be in which happens to have a master page.
If I give 2 really basic pages, the first is a non-master page which the javascript correctly fires from:
Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body onload="testing()">
<script language="javascript" type="text/javascript">
<!--
//Run when page loads.
function testing()
{
alert(Are you listening?);
}
//-->
</script>
<form id="form1" runat="server">
<table>
<tr style="padding-left:400px">
<td valign="middle">
<asp:Button ID="btnFade" runat="server" Text="Fade"/>
</td>
<td valign="middle">
<img runat="server" id="imgInfo" src="Images/updateSuccessful.jpg" alt=""/>
</td>
</tr>
</table>
</form>
</body>
</html>
The second has a master page and the javascript does not fire:
Code:
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div onload="testing()">
<script language="javascript" type="text/javascript">
<!--
//Run when page loads.
function testing()
{
alert(Are you listening?);
}
//-->
</script>
</div>
</asp:Content>
Can somebody tell me where I am going wrong?
Thanks, Dave.