How to call javascript function on page load in asp.net

AbsolutVodka

New Member
i have application in asp.net 4.0i have javascript to display client zone offset into text box:-`\[code\]<script type="text/javascript"> 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('<%= offSet.ClientID%>').value = http://stackoverflow.com/questions/14079029/retVal; }</script>\[/code\]`Html MarkUp\[code\]<asp:HiddenField ID="clientDateTime" runat="server" /><asp:HiddenField ID="offSet" runat="server" /><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></body>\[/code\]please suggest how can i call this function on page load so that i can display offset into textbox.Thanks in advanced
 
Back
Top