Not able to use javascript variable in code behind in C#
<p>Guys I am using a jquery price range slider for getting Price range from user.But the problem is that the Price range selected by user on slider I have to use that in code behind.My code is like this:
 My java script:</p>

<pre><code> &lt;script type="text/javascript"&gt;
        //adding load class to body and hide page
        document.documentElement.className += 'loadstate';
    &lt;/script&gt;
    &lt;script type ="text/javascript" &gt;
      var str1=  document.getElementById("amt3").value;
     var str2=   document.getElementById("amt4").value;
     document.getElementById("hf1").value = str1;
     document.getElementById("hf2").value = str2;
    &lt;/script&gt;

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

<p>My Html code is like this:</p>

<pre><code> &lt;asp:HiddenField ID="hf1" runat="server" /&gt;
    &lt;asp:HiddenField ID="hf2" runat="server" /&gt;
    &lt;div class="form-row row-fluid"&gt;
        &lt;div class="span12"&gt;
            &lt;div class="row-fluid"&gt;
                &lt;label class="form-label span4" for="slider"&gt;
                    Range slider&lt;/label&gt;
                &lt;div class="span8"&gt;
                    &lt;asp:UpdatePanel ID="UpdatePanel2" runat="server"&gt;
                    &lt;ContentTemplate &gt;
                        &lt;asp:HiddenField ID="HiddenField1" runat="server" /&gt;
                    &lt;div id="slider-range"    class="slider" &gt;
                    &lt;/div&gt;
                    &lt;input type="text" id="amount1" style="border: 0; color: #ED7A53; font-weight: bold;
                        box-shadow: none;" /&gt;
                    &lt;input type="text" id="amt3"    style="border: 0; color: #ED7A53; font-weight: bold;
                        box-shadow: none;" /&gt;
                    &lt;input type="text" id="amt4"    name="amt4" style="border: 0; color: #ED7A53;
                        font-weight: bold; box-shadow: none;" /&gt;
                        &lt;/ContentTemplate&gt;
                    &lt;/asp:UpdatePanel&gt;
                &lt;/div&gt;
            &lt;/div&gt;
        &lt;/div&gt;
</code></pre>

<p>and My code Behind is like this:</p>

<pre><code> protected void lnkFilter_Click1(object sender, EventArgs e)

        {

          string str=  hf1.Value;
            if (WebHelper.Cast(amt2.Value, 0) != 0)
            {
                Fill();

            }


            }
</code></pre>

<p>But the Problem is hf1 (hidden field) is getting empty string value.Please help me in this and suggest me a solution how to use selected range on jquery slider in code behind file.</p>
