locked
display value 1,2,3,4 and 5 using Ajax slider example. RRS feed

  • Question

  • User-2144563216 posted

    I want to display the I,2,3,4 and 5 on a textbox or label using ajax slider extender to enable the user to rate.

     The problems is the numbers are not being displayed.

    this is what I have so far.

    thanks.

     <asp:TextBox ID="txtDisplayValue" runat="server"></asp:TextBox>
     
     
     
                <ajaxToolkit:SliderExtender 
                    ID="txtDisplayValue_SliderExtender"
                    runat="server"
                    BehaviorID="txtDisplayValue_SliderExtender"
                    Maximum="5" Minimum="1" TargetControlID="txtDisplayValue"  BoundControlID="txtDisplayValue" EnableHandleAnimation="true" />
    Monday, February 18, 2019 7:20 PM

Answers

  • User-893317190 posted

    Hi earlcools,

    You should specify another control to BoundControlID of slider.

    Below is my code.If you want  label and slider to appear in the same line ,just add test class or remove the RailCssClass

     <title></title>
        <style>
            .test{
                display:inline-block
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <div>
         
            <ajaxToolkit:SliderExtender ID="SliderExtender1" runat="server" RailCssClass="ajax__slider_h_rail test" TargetControlID="txtDisplayValue" Steps="5"  Maximum="5" Minimum="1" BoundControlID="Label1">  
          
                  
    </ajaxToolkit:SliderExtender>
                <asp:TextBox ID="txtDisplayValue" runat="server"></asp:TextBox>
            <asp:Label ID="Label1" runat="server" Text="Label" Font-Size="X-Large"></asp:Label>    
                </div>
            

    The result.

    Best regards,

    Ackerly Xu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 19, 2019 2:52 AM

All replies

  • Tuesday, February 19, 2019 12:25 AM
  • User-893317190 posted

    Hi earlcools,

    You should specify another control to BoundControlID of slider.

    Below is my code.If you want  label and slider to appear in the same line ,just add test class or remove the RailCssClass

     <title></title>
        <style>
            .test{
                display:inline-block
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <div>
         
            <ajaxToolkit:SliderExtender ID="SliderExtender1" runat="server" RailCssClass="ajax__slider_h_rail test" TargetControlID="txtDisplayValue" Steps="5"  Maximum="5" Minimum="1" BoundControlID="Label1">  
          
                  
    </ajaxToolkit:SliderExtender>
                <asp:TextBox ID="txtDisplayValue" runat="server"></asp:TextBox>
            <asp:Label ID="Label1" runat="server" Text="Label" Font-Size="X-Large"></asp:Label>    
                </div>
            

    The result.

    Best regards,

    Ackerly Xu

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 19, 2019 2:52 AM
  • User1512768972 posted

    hi... i suggest choose html5 input Range...

    Not is required load scriptmanager, and the size of page reduced.

    How?

    in your case

    <div> <asp:TextBox ID="txtDisplayValue" runat="server" min="1" max="5"    step="1"></asp:TextBox></div>

    more info

    https://developer.mozilla.org/es/docs/Web/HTML/Elemento/input/range

    hope helps you

    Thursday, February 21, 2019 12:42 PM