set value to hidden input
<p>Can anyone tell me what am I doing wrong. The hiddenvalue is being kept all the time null without any value assigned to it. </p>

<p>The following is the code;</p>

<p><strong>Javacript</strong></p>

<p>This is intended to occur on a click event on a map</p>

<pre><code>var str = "ryan";
document.getElementById("hiddenvalue").value = str;
</code></pre>

<p>This is from the asp.net</p>

<pre class="lang-html prettyprint-override"><code>&lt;div&gt;
    &lt;input id="hiddenvalue" type="hidden" value="" runat="server"/&gt;
    &lt;asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" /&gt;
&lt;/div&gt;
</code></pre>

<p>And this is how am I referring to it from the codebehind:</p>

<pre class="lang-c# prettyprint-override"><code>using (NpgsqlCommand cmd = new NpgsqlCommand("insert into altitude select nextval('altitude_id_seq'), :value", conn)) {
    cmd.Parameters.Add(new NpgsqlParameter("value", NpgsqlDbType.Varchar));
    cmd.Parameters[0].Value = hiddenvalue.Value; 
    cmd.ExecuteNonQuery();
}
</code></pre>

<p>For some reason no value is being set. Can anyone guide since I have been for hours trying to debug this issue.</p>
