Send data from javascript to code behind at first load
<p>I am actually buidling a web application and I need to get data of the local environment of the machine viewing the application.To do this, I use a little javascript script such as:</p>

<pre><code>&lt;script language="javascript"&gt;
 function GetUserName()
    {
        //Permits to get username of client machine
        var wshell = new ActiveXObject("WScript.Shell");
        var arpege = wshell.ExpandEnvironmentStrings("%USERNAME%");
        document.getElementById("arpege").value=arpege;



    }
&lt;/script&gt;


 &lt;input type=hidden id="arpege" runat=server /&gt;
</code></pre>

<p>My problem is that this script is executed after the page is loaded and so I can't use it on the page load...</p>

<p>My code on the page load is:</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
    {
        myConnection.ConnectionString = ActionSource.ConnectionString;
        myConnection.Open();

        String account = arpege.value;

        ...

    }
</code></pre>

<p>But i just get "" in account...</p>

<p>Thanks for your help,</p>

<p>Quentin</p>
