slider control

B

bill

How can I create a slider control or visual scale control which fires a
server-side event when a selection is made?

I would appreciate any tips.

Thanks
Bill
 
K

Kevin Spencer

What sort of tips are you looking for? Ideas for building one, or
third-party tools?

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

What You Seek Is What You Get.
 
B

bill

I would prefer to find a way to create my own, since the functionality I
need is minimal - click on a scale and return a numeric value between 1 and
100 to the server.

Currently I am using a table with 100 cells, each containing a button with a
command argument between 1 and 100.

The table is created dynamically, and the buttons are wired to an event
handler which saves the value. Other types of dynamically created controls
(radio buttons, check boxes, dropdown lists, etc.) also use this event
handler.

It works fine, except that I would rather the scale selection did not post
back immediately. Instead, I would rather wait until the page is posted
back by a Save button and process all event handlers at the same time. This
does not appear to be possible, though, as discussed in my post about
preventing autopostback for a button click.

Thanks
Bill
 
N

neilmcguigan

find a dhtml slider control on the web somewhere

it should either have a hidden form control that it writes to (which
you can grab on the server side), or it will have a client side event
that is raised when the user lets go of the mouse. you can then write
to a hidden form field in the event handler.

in either case you could use:

string sliderPercent = Request.Form["myHiddenSliderValue"];
 
K

Kevin Spencer

Yes, in fact, the following article details how to create a slider that
employs JavaScript to render HTML and handle the client-side interaction. It
could easily be adopted to a Server Control:

http://www.phys.uu.nl/~hofman/jsexp/explslider.html

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

What You Seek Is What You Get.


find a dhtml slider control on the web somewhere

it should either have a hidden form control that it writes to (which
you can grab on the server side), or it will have a client side event
that is raised when the user lets go of the mouse. you can then write
to a hidden form field in the event handler.

in either case you could use:

string sliderPercent = Request.Form["myHiddenSliderValue"];

I would prefer to find a way to create my own, since the functionality I
need is minimal - click on a scale and return a numeric value between 1
and
100 to the server.

Currently I am using a table with 100 cells, each containing a button
with a
command argument between 1 and 100.

The table is created dynamically, and the buttons are wired to an event
handler which saves the value. Other types of dynamically created
controls
(radio buttons, check boxes, dropdown lists, etc.) also use this event
handler.

It works fine, except that I would rather the scale selection did not
post
back immediately. Instead, I would rather wait until the page is posted
back by a Save button and process all event handlers at the same time.
This
does not appear to be possible, though, as discussed in my post about
preventing autopostback for a button click.

Thanks
Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top