Slider value not updated consistently using Ajax Manager

2 posts, 0 answers
  1. Gen Li
    Gen Li avatar
    1 posts
    Member since:
    Nov 2007

    Posted 07 Apr 2015 Link to this post



    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" >
                   <telerik:AjaxSetting AjaxControlID="DbgSlider1">
                           <telerik:AjaxUpdatedControl ControlID="Slider1Text" UpdatePanelRenderMode="Inline"></telerik:AjaxUpdatedControl >
    <telerik:RadSlider runat="server" ID="DbgSlider1" Width="400px"
                            IsSelectionRangeEnabled="false" MinimumValue="0" MaximumValue="50000" Step="5000"
                            AutoPostBack="true" ShowDecreaseHandle="false" ShowIncreaseHandle="false" EnableDragRange="true"
                            EnableServerSideRendering="true" >
       <dbg:DbgTextBox ID="Slider1Text" runat="server">

  2. Slav
    Slav avatar
    1359 posts

    Posted 09 Apr 2015 Link to this post


    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.


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

Back to Top