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:
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?
pettrer
Participant
970 Points
469 Posts
correct way of getting postback from jQuery slider
Apr 23, 2012 08:16 AM|LINK
Hi all,
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:
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?
Here's the slider demo url: http://jqueryui.com/demos/slider/#steps
Here's the slider code:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Slider - Snap to increments</title> <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css"> <script src="../../jquery-1.7.2.js"></script> <script src="../../ui/jquery.ui.core.js"></script> <script src="../../ui/jquery.ui.widget.js"></script> <script src="../../ui/jquery.ui.mouse.js"></script> <script src="../../ui/jquery.ui.slider.js"></script> <link rel="stylesheet" href="../demos.css"> <style> #demo-frame > div.demo { padding: 10px !important; }; </style> <script> $(function() { $( "#slider" ).slider({ value:100, min: 0, max: 500, step: 50, slide: function( event, ui ) { $( "#amount" ).val( "$" + ui.value ); } }); $( "#amount" ).val( "$" + $( "#slider" ).slider( "value" ) ); }); </script> </head> <body>Love to all,
Pettrer, Sweden