How to call javascript function on page load in asp.net
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/807878/javascript-that-executes-after-page-load">Javascript that executes after page load</a>  </p>
</blockquote>



<p>i have application in asp.net 4.0</p>

<p>i have javascript to display client zone offset into text box:-
`</p>

<pre><code>&lt;script type="text/javascript"&gt;
    function GetTimeZoneOffset() {
        var d = new Date()
        var gmtOffSet = -d.getTimezoneOffset();
        var gmtHours = Math.floor(gmtOffSet / 60);
        var GMTMin = Math.abs(gmtOffSet % 60);
        var dot = ".";
        var retVal = "" + gmtHours + dot + GMTMin;
        document.getElementById('&lt;%= offSet.ClientID%&gt;').value = retVal;
    }

&lt;/script&gt;
</code></pre>

<p>`</p>

<p><strong>Html MarkUp</strong></p>

<pre><code>&lt;asp:HiddenField ID="clientDateTime" runat="server" /&gt;
&lt;asp:HiddenField ID="offSet" runat="server" /&gt;
&lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;/body&gt;
</code></pre>

<p>please suggest how can i call this function on page load so that i can display offset into textbox.</p>

<p>Thanks in advanced</p>
