Click here to Skip to main content
15,881,803 members
Articles / Web Development / ASP.NET

ASPSlider: A Slider Control for ASP.NET

Rate me:
Please Sign up or sign in to vote.
3.35/5 (11 votes)
22 Sep 20052 min read 167.7K   9.3K   51   18
ASPSlider is a highly customizable easy to use slider controlslider control implemented in ASP.NET.
ASPSlider is a highly customizable and easy to use slider control which is free (for noncommercial use). ASPSlider uses DHTML extensively to achieve its functionality.

Introduction

ASPSlider is a slider control implemented in ASP.NET. Simply click anywhere on the slider, move your mouse to the desired position, and click again. ASPSlider is a highly customizable and easy to use slider control. It is free (for noncommercial use). ASPSlider uses DHTML extensively to achieve its functionality. Till now, it has only been tested with IE6.

Screenshots

HTML
<ASPSlider id="ASPSlider1" 
runat="server" 
SliderImageURL="images/arr7.gif" 
SliderTextColor="Orange" 
ScaleBgImageURL="images/backr.gif" 
CurrentValue="0" 
MaxValue="100" MinValue="0" 
SliderHeight="2px" 
SliderWidth="270px>
</uc1:ASPSlider>

HTML
<uc1:ASPSlider id="ASPSlider2" 
runat="server" 
SliderImageURL="images/dot.gif" 
ScaleBgImageURL="images/backs.gif" 
CurrentValue="250" SliderHeight="22px" 
MiddleTextClass="orangetext" 
ValueLabelClass="myclass" 
SliderWidth="270px" 
MaxValue="300" MinValue="100" 
SliderBorderSize="0" 
SliderBorderColor="Red">
</uc1:ASPSlider>

HTML
<uc1:ASPSlider id="ASPSlider3" 
runat="server" 
SliderImageURL="images/arr5.gif" 
ScaleBgImageURL="images/back3.jpg" 
CurrentValue="25" SliderHeight="20px" 
SliderWidth="270px" MinValue="0" 
MaxValue="50"></uc1:ASPSlider>

HTML
<uc1:ASPSlider id="ASPSlider4" 
runat="server" 
SliderImageURL="images/arr8.gif" 
ScaleBgImageURL="images/back9.gif" 
CurrentValue="250" 
SliderHeight="22px" 
ValueLabelClass="redclass" 
MiddleTextClass="redclass" 
SliderWidth="270px" 
MaxValue="400" MinValue="250" 
SliderBorderSize="0" 
SliderBorderColor="Red"></uc1:ASPSlider>

 

Client slide event example. When any of the slider's values is changed, the round figure changes its position on screen.
Refer to file ClientScript.aspx.

 

 

Color selector implemented using client side events of ASPSlider. When user clicks 'Apply' the text color of center label changes. This is done at server side.
Refer to file ColorSelector.aspx.

 

I made ASPSlider in my free time. With the rise in popularity of ASP.NET and WebForms, the demand for more ‘Windows’ like controls for web applications has risen. ASPSlider tries to mimic the behavior of Windows Slider control as far as possible. It allows the user to select a value in a given range. To select or change the value, first you have to click on the slider, then move your mouse to the desired position and click again. ASPSlider mainly relies on a complex combination of JavaScript and DHTML to achieve its functionality.

The major challenge in implementing the control was to remember the current value and position across postbacks. Lots of features are still to be added to the control. Also the control needs a lot of testing. I hope people downloading this control will use it and mail me their feedback, suggestions and bugs.

ASPSlider also allows client-side scripting. Just set the OnChangeClientCallBack property to the name of the client side JavaScript that will be called whenever the value of the slider changes. The JavaScript function should accept one parameter, which is used to supply the current value. Example:

JavaScript
<script>
function move(x)
{ //…..code goes here }
</script>

A Word about using ASPSlider

This control is an open source software. You can use if for free only for non-commercial purposes. If you need to use it commercially or want me to make any custom enhancements, please contact me by leaving a comment below.

History

  • 31st May, 2005: Initial post

License

This article has no explicit license attached to it, but may contain usage terms in the article text or the download files themselves. If in doubt, please contact the author via the discussion board below. A list of licenses authors might use can be found here.


Written By
Web Developer
India India
Ashish is an Electronics Engineer. He loves computers and programming, and always tries to do something different. Ashish started his programming career with FoxPro 2.5 (6 years ago) .Ashish has programmed in number of languages including C\C++ , Tcl\Tk , Assembly Language , JavaScript. Currently he works with ASP.NET, C# and VB.NET. He is currently working in multinational consulting company in India.

He devotes much of his free time to his website: http://ashishware.com , which contains lot of cool stuff on webdevelopment and programing in general.

Comments and Discussions

 
QuestionI can't add ASPSlider.dll. VS2010 says that ASPSlider.dll doesn't contain any components to install. Pin
vlad27528-Mar-12 21:41
vlad27528-Mar-12 21:41 
GeneralVisual Studio Folders Pin
CWetnose14-Apr-11 6:15
CWetnose14-Apr-11 6:15 
GeneralDynamically Added in ASP.NET Form Pin
josuealepan19-Oct-10 7:51
josuealepan19-Oct-10 7:51 
Generali need to create multiple sliders based on a return from sp Pin
imatureStudent8-Mar-10 6:51
imatureStudent8-Mar-10 6:51 
Questionhow to Assing a current value using javascript Pin
mazhar_imam_khan2-Jul-08 0:23
mazhar_imam_khan2-Jul-08 0:23 
GeneralNot Working FireFox Pin
AvaniFaldu25-Mar-08 3:12
AvaniFaldu25-Mar-08 3:12 
GeneralNo DRAG and DROP behavior Pin
Michael Freidgeim28-Nov-07 16:17
Michael Freidgeim28-Nov-07 16:17 
QuestionSecond Handle? Pin
Sameers Javed22-Jul-07 1:40
Sameers Javed22-Jul-07 1:40 
GeneralSounds Good Pin
Sameers Javed24-Mar-06 3:44
Sameers Javed24-Mar-06 3:44 
The slider as per the description looks good, not tested yet though, but hope it will be great. I personally have been thinking for such control. As per the issue of dragging, I think this may not be very complex, maybe, if I altered that then I will share with peoples here.

Good Luck Laugh | :laugh: ,
Sameers

Need custom software? Contact DevelopersINN[^]
Need to add reminders for your Outlook emails? Try Outlook Personal Assistant[^]
GeneralGood but Pin
jumacabo30-May-05 23:24
jumacabo30-May-05 23:24 
GeneralRe: Good but Pin
ashish_patil++31-May-05 0:42
ashish_patil++31-May-05 0:42 
GeneralRe: Good but Pin
Roger Alsing31-May-05 1:46
Roger Alsing31-May-05 1:46 
GeneralRe: Good but Pin
ashish_patil++31-May-05 2:37
ashish_patil++31-May-05 2:37 
GeneralRe: Good but Pin
Roger Alsing31-May-05 2:42
Roger Alsing31-May-05 2:42 
GeneralRe: Good but Pin
Anonymous31-May-05 6:37
Anonymous31-May-05 6:37 
GeneralRe: Good but Pin
Anonymous31-May-05 6:48
Anonymous31-May-05 6:48 
GeneralMessage Closed Pin
27-Sep-05 16:28
comeltan27-Sep-05 16:28 
GeneralRe: Good but Pin
jingking29-Jul-06 4:08
jingking29-Jul-06 4:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.