This is a migrated thread and some comments may be shown as answers.

Slider value not updated consistently using Ajax Manager

1 Answer 20 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Gen Li
Top achievements
Rank 1
Gen Li asked on 07 Apr 2015, 01:54 PM

Hi,

 

I am trying to send Slider value to a textbox using AjaxManager. I want the value to be displayed in the textbox OnValueChanged. I do not want to use OnClientValueChanged as I want to use a codebehind method.

The issue is that the slider value is not updated consistently in the textbox every time I drag the slider handle. Sometimes it responds after two clicks or more and sometimes it starts working fine.

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
 
      <telerik:RadAjaxManager ID="RadSlider1" runat="server" EnableAJAX="True" >
           <AjaxSettings>
               
               <telerik:AjaxSetting AjaxControlID="DbgSlider1">
                   <UpdatedControls>
                       <telerik:AjaxUpdatedControl ControlID="Slider1Text" UpdatePanelRenderMode="Inline"></telerik:AjaxUpdatedControl >
                          </UpdatedControls>
                   </telerik:AjaxSetting>
                             </AjaxSettings>
       </telerik:RadAjaxManager>
 
 
<telerik:RadSlider runat="server" ID="DbgSlider1" Width="400px"
 
                        IsSelectionRangeEnabled="false" MinimumValue="0" MaximumValue="50000" Step="5000"
 
                        OnValueChanged="SetValue"
 
                        AutoPostBack="true" ShowDecreaseHandle="false" ShowIncreaseHandle="false" EnableDragRange="true"
 
                        EnableServerSideRendering="true" >
     
    </telerik:RadSlider>
   <dbg:DbgTextBox ID="Slider1Text" runat="server">
    </dbg:DbgTextBox>

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 09 Apr 2015, 04:02 PM
Hi,

It is possible that sometimes the processing of the request on the server takes more time than expected. If you drag the slider handle, then drag it again before the first request is finished, the request will be aborted and a new one will be initiated. As a result the value of the textbox will update only after the last uninterrupted requested is processed.

You could use a RadAjaxLoadingPanel in combination with the RadAjaxManager so that it is easier to see if a request is still being processed and to prevent the drag handle of the slider from being dragged until the server responds. I attached a small sample that shows how you can achieve this.

Regards,
Slav
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Slider
Asked by
Gen Li
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or