Call JavaScript in  Pageload in VS2005
<pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %&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;script language="JavaScript" type="text/JavaScript"&gt;
CheckBrow();
&lt;/script&gt;


function  CheckBrow()
{
  if((navigator.appName == "Microsoft Internet Explorer") ||(navigator.appName == "Netscape"))
  {
   HhdnBrowsertype.value=0;
  }
  else
  {
  alert("please open the application in IE or Fire fox browser")
  HhdnBrowsertype.value=1;
  }
}


&lt;head runat="server"&gt;
    &lt;title&gt;Untitled Page&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
    &lt;div&gt;
        &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt;
        &lt;asp:HiddenField ID="HhdnBrowsertype" runat="server" /&gt;
    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Here is my JavaScript function.  Now I need to execute this function on page load.</p>

<p>Here I will check the browser type based on the hidden field value 0 or 1.</p>

<p>I will check this hidden field value on page load </p>

<pre><code>    protected void Page_Load(object sender, EventArgs e)
        {
// here  i need to call  my javscript  function
//  can any one  tell me the  syntax
          If(HhdnBrowsertype.Value==”1”)
    {
    // here  go my page load  function 
    }

        }
</code></pre>

<p>Can anyone tell me how I can call this JavaScript function on page load?  I am using VS 2005.</p>
