Is there any web slider VALUE CHANGED event like with the TextBox that has a TEXT CHANGED event?
Hello Wayne,
For handling the value changed event in the WebSlider you can define this in the ClientEvents node of the WebSlider. Here's an example of the markup you can setup:
<ig:WebSlider ID="WebSlider1" runat="server"> <ClientEvents ValueChanged="WebSlider1_ValueChanged" /></ig:WebSlider>
The definition you can define for the ValueChanged event can look like this since it's defined as WebSlider1_ValueChanged:
function WebSlider1_ValueChanged(sender, eventArgs){ ///<summary> /// ///</summary> ///<param name="sender" type="Infragistics.Web.UI.WebSlider"></param> ///<param name="eventArgs" type="Infragistics.Web.UI.SliderValueChangedEventArgs"></param> //Add code to handle your event here. var label = document.getElementById('<%= Label1.ClientID %>'); label.innerText = 'WebSlider new value changed to ' + eventArgs.get_newValue();}// -->
Whenever the user changes a new value in the control then this method will execute everytime in JavaScript. In this example will show the new value that was selected in the control and the eventArgs parameter object is the one that contains this value. For a reference feel free to look at documentation on our api, you can reach the url using this link for more information related to this event: http://help.infragistics.com/NetAdvantage/ASPNET/2010.2/CLR4.0/?page=Infragistics4.Web.v10.2~Infragistics.Web.UI.EditorControls.SliderClientEvents~ValueChanged.html.
I have attached a sample for this that demonstrates the code presented above on handling value changed. This is only a client side (JavaScript operation). In the case of handling it on the server you can set under AutoPostBackFlags property and then ValueChanged as 'On'. When adding the WebSlider control, ValueChanged is automatically set to Off.
Please note that when opening the sample there is no ig_res folder provided in the zip. Files contain images and css files that are too large to send over. You can just open it in visual studio and then on the default.aspx page you can switch over to design view. It should automatically create the necessary files so that you can see the control visually when the application is running.
That's pretty much an overview of handling value changed.
Let me know if you have any further questions with this matter.
Sincerely,Duane HoytDeveloper Support Engineer, MCTSInfragisticshttp://es.infragistics.com/support
Thank you! I think I've got it now.
Great, thanks for the notice. Do you have any further questions on this. If not the case will be closed, you always have the option to reopen later.
Thank you for contacting Developer Support.
Duane:
I am still having issues with the webslider ValueChanged event. I have five sliders and moving the thumb does not seem to me to trigger the ValueChanged event. I have ithe webslider control's ValueChanged property set to ON. And I have code for the webslider's ValueChanged event.
A few questions:
(1) What is the difference between ON and ASYNC?
(2) Is there a javascript code that I need to add for AutoPostBack on a mouse-button-up (or similar) event?
Please reply.
Thank you.
I have checked that the ValueChanged event fires once the mouse button has been pressed and released. You can always test all the client events of the webslider to see any of them that will fit your needs. When handling mouse events it is good to handle on the client side only since post backs can cause performance to your application.
When setting ValueChanged to ON will mean that code is handling as a full page postback which is slower in performance. Setting ValueChanged to Async will handle the server side events and will process the code on the server without having the browser to wait for the server side to process.
So the following scenarios would follow:
- For handling javascript code only set ValueChanged to OFF.- For both javascript and server side coding use ASYNC.- For server side only coding use ON.
Let me know if you have any questions with this matter.
Hello:
I have a similar issue with a client. I am using vs2008 and your ASP.NET webslider control. I copied code from one valuechanged event to another valuechanged event in a different program and I admit it did not work. The code is not being executed at all. It appears to me the postback you referenced above is not taking place.
Must we have the vs2008 wizard create the valuechanged event for the developer?? Or should the developer be able to copy/paste code from one program to another??
You mention postback. How does one code in javascript a postback ??
Please help me - I need need some help.
Cheers!
--Bobbi
Thank you for your reply. However, I am still "stuck."
The previous developer used the web slider extender from the CodePlex Ajax Toolkit. It had five sliders and movement in any one handle triggers a SQL script on the server (there is a 3-5 second pause).
When I replaced the five web slider extenders with Infragistics'webslider controls, I am now not getting the SQL script triggered on the server. I put a "message" in the _ValueChanged event and the "message" does not appear, implying the code in the _ValueChanged event is not being executed.
I have it set for "Server side only." I tried "ASYNC" but saw no difference - which I found peculiar.
I have missed something. How might you recommend I proceed in troubleshooting?