how to run js on every childpage?
<p>i am trying  to run my javascript on every child page, masterpagecode:</p>

<pre><code>&lt;%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site1.master.cs" Inherits="WindowonUnload.Site1" %&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;asp:ContentPlaceHolder ID="head" runat="server"&gt;

    &lt;/asp:ContentPlaceHolder&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
    &lt;div&gt;
        &lt;asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"&gt;
         &lt;script&gt;
             //window.addEventListener('unload', function () { alert('hahaha'); });
             window.onunload = function () {
                 alert('from webf master');
             }
    &lt;/script&gt;
        &lt;/asp:ContentPlaceHolder&gt;
    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>childpage:</p>

<pre><code>&lt;%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true"
    CodeBehind="WebForm1.aspx.cs" Inherits="WindowonUnload.WebForm1" %&gt;

&lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"&gt;
&lt;/asp:Content&gt;
&lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt;

&lt;/asp:Content&gt;
</code></pre>

<p>what am I doing wrong?</p>
