correct way of getting postback from jQuery sliderhttp://forums.asp.net/t/1795810.aspx/1?correct+way+of+getting+postback+from+jQuery+sliderMon, 23 Apr 2012 12:43:24 -040017958104945750http://forums.asp.net/p/1795810/4945750.aspx/1?correct+way+of+getting+postback+from+jQuery+slidercorrect way of getting postback from jQuery slider <p>Hi all,</p> <p>I'm new to jQuery and I have been doing a lot of reading on the Internet on jQuery plus Asp.Net. I have come across different solutions/hacks on how to incorporate the two technologies and I wonder what the correct/easiest way is. Here's my problem:</p> <p>I originally planned to use the Ajax control toolkit's slider control, but am now trying to move to a jQuery slider instead. How should I cause a postback (I want to update a gridview based on the new value) when the user sets another value from the slider?</p> <p>Here's the slider demo url: <a href="http://jqueryui.com/demos/slider/#steps"> http://jqueryui.com/demos/slider/#steps</a>&nbsp;</p> <p>Here's the slider code:</p> <pre class="prettyprint">&lt;!DOCTYPE html&gt; &lt;html lang=&quot;en&quot;&gt; &lt;head&gt; &lt;meta charset=&quot;utf-8&quot;&gt; &lt;title&gt;jQuery UI Slider - Snap to increments&lt;/title&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;../../themes/base/jquery.ui.all.css&quot;&gt; &lt;script src=&quot;../../jquery-1.7.2.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;../../ui/jquery.ui.core.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;../../ui/jquery.ui.widget.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;../../ui/jquery.ui.mouse.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;../../ui/jquery.ui.slider.js&quot;&gt;&lt;/script&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;../demos.css&quot;&gt; &lt;style&gt; #demo-frame &gt; div.demo { padding: 10px !important; }; &lt;/style&gt; &lt;script&gt; $(function() { $( &quot;#slider&quot; ).slider({ value:100, min: 0, max: 500, step: 50, slide: function( event, ui ) { $( &quot;#amount&quot; ).val( &quot;$&quot; &#43; ui.value ); } }); $( &quot;#amount&quot; ).val( &quot;$&quot; &#43; $( &quot;#slider&quot; ).slider( &quot;value&quot; ) ); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt;</pre> <p>&nbsp;</p> <p>Love to all,</p> <p>Pettrer, Sweden</p> 2012-04-23T08:16:56-04:004946177http://forums.asp.net/p/1795810/4946177.aspx/1?Re+correct+way+of+getting+postback+from+jQuery+sliderRe: correct way of getting postback from jQuery slider <p>You need to call the postback manually using javascript within the slide function of the slider, i.e. after&nbsp;</p> <pre class="prettyprint">$( &quot;#amount&quot; ).val( &quot;$&quot; &#43; ui.value );</pre> <p>See here on how to do this:&nbsp;<a href="http://www.dotnetspider.com/resources/1521-How-call-Postback-from-Javascript.aspx">http://www.dotnetspider.com/resources/1521-How-call-Postback-from-Javascript.aspx</a></p> 2012-04-23T11:06:52-04:004946219http://forums.asp.net/p/1795810/4946219.aspx/1?Re+correct+way+of+getting+postback+from+jQuery+sliderRe: correct way of getting postback from jQuery slider <p>Hi,</p> <p>Subscrive the change event of the slider. In the change event call __dopostback like below-</p> <p><a href="http://www.delicious.com/anupdg/__doPostBack">http://www.delicious.com/anupdg/__doPostBack</a></p> 2012-04-23T11:20:54-04:004946409http://forums.asp.net/p/1795810/4946409.aspx/1?Re+correct+way+of+getting+postback+from+jQuery+sliderRe: correct way of getting postback from jQuery slider <p>Guys,</p> <p>Thanks a lot for your swift replies!</p> <p>/Pettrer</p> 2012-04-23T12:43:24-04:00