how to add/change css for MultiHandleSliderExtender

In this Article i will explian how to add css for MultiHandleSliderExtender

step1-add ajaxtoolkit manager in page.

   <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>

step2-add  MultiHandleSliderExtender in page.

<div>
     <asp:TextBox ID="txtfrom" runat="server" Width="70" Text="0"></asp:TextBox>
        <asp:TextBox ID="txtto" runat="server" Width="70" Text="200"></asp:TextBox>
        <br /><br />
        <asp:MultiHandleSliderExtender ID="MultiHandleSliderExtender1" ShowHandleDragStyle="true" runat="server"  BehaviorID="multiHandleSliderExtenderTwo"
            ShowInnerRail="true" HandleAnimationDuration="0.1" TooltipText="{0}" TargetControlID="slider" InnerRailStyle="SlidingDoors"
            CssClass="ajax__multi_slider_custom" RaiseChangeOnlyOnMouseUp="true" Minimum="0"
            Maximum="100">
            <MultiHandleSliderTargets>
                <asp:MultiHandleSliderTarget ControlID="txtfrom" HandleCssClass="handle-x-left" />
                <asp:MultiHandleSliderTarget ControlID="txtto" HandleCssClass="handle-x-right" />
            </MultiHandleSliderTargets>
        </asp:MultiHandleSliderExtender>
        <asp:TextBox ID="slider" runat="server"></asp:TextBox>
    </div>

step2- change default css properties of MultiHandleSliderExtender within <head></head>

<style type="text/css">
/*----------Price Slider start------------*/

.ajax__multi_slider_custom .outer_rail_horizontal {
    position: absolute;
    background-color: black;
     
}

.ajax__multi_slider_custom .handle-x-left
        {
            position: absolute;
           
            background-color: #038f94;
            cursor:pointer;
            width: 15px;
             height: 20px;
            z-index: 200;
border:none;
           top:-5px !important;
        }
        .ajax__multi_slider_custom .handle-x-right
        {
                position: absolute;
       
            cursor:pointer;
           
  background-color: #038f94;
            width: 15px;
            height: 20px;
            z-index: 999999;
border:none;
top:-5px !important;
       
        }
        .ajax__multi_slider_custom
        {
       
            position: relative;
            color:black;
           background:#fb6400;

           width:200px;
             height: 10px;
            z-index: 100;

   }
#mCSB_1_container span {
    color: #038f94;
    display: inline-block;
    font-weight: bold;
    padding: 0 15px;
    padding-left: 2px;
    width: 54px;
}

/*----------Price Slider  end------------*/
    </style>



overall source code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="CookiesAddToCart.WebForm2" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
/*----------Price Slider start------------*/

.ajax__multi_slider_custom .outer_rail_horizontal {
    position: absolute;
    background-color: black;
     
}

.ajax__multi_slider_custom .handle-x-left
        {
            position: absolute;
           
            background-color: #038f94;
            cursor:pointer;
            width: 15px;
             height: 20px;
            z-index: 200;
border:none;
           top:-5px !important;
        }
        .ajax__multi_slider_custom .handle-x-right
        {
                position: absolute;
       
            cursor:pointer;
           
  background-color: #038f94;
            width: 15px;
            height: 20px;
            z-index: 999999;
border:none;
top:-5px !important;
       
        }
        .ajax__multi_slider_custom
        {
       
            position: relative;
            color:black;
           background:#fb6400;

           width:200px;
             height: 10px;
            z-index: 100;

   }
#mCSB_1_container span {
    color: #038f94;
    display: inline-block;
    font-weight: bold;
    padding: 0 15px;
    padding-left: 2px;
    width: 54px;
}

/*----------Price Slider  end------------*/
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
    <div>
     <asp:TextBox ID="txtfrom" runat="server" Width="70" Text="0"></asp:TextBox>
        <asp:TextBox ID="txtto" runat="server" Width="70" Text="200"></asp:TextBox>
        <br /><br />
        <asp:MultiHandleSliderExtender ID="MultiHandleSliderExtender1" ShowHandleDragStyle="true" runat="server"  BehaviorID="multiHandleSliderExtenderTwo"
            ShowInnerRail="true" HandleAnimationDuration="0.1" TooltipText="{0}" TargetControlID="slider" InnerRailStyle="SlidingDoors"
            CssClass="ajax__multi_slider_custom" RaiseChangeOnlyOnMouseUp="true" Minimum="0"
            Maximum="100">
            <MultiHandleSliderTargets>
                <asp:MultiHandleSliderTarget ControlID="txtfrom" HandleCssClass="handle-x-left" />
                <asp:MultiHandleSliderTarget ControlID="txtto" HandleCssClass="handle-x-right" />
            </MultiHandleSliderTargets>
        </asp:MultiHandleSliderExtender>
        <asp:TextBox ID="slider" runat="server"></asp:TextBox>
    </div>
    </form>
</body>
</html>








Comments

Post a Comment

Popular posts from this blog

Bootstrap Modal Popup keep open on PostBack in ASP.Net

Resolved Issue in Asp core 3.0 serializersettings does not exist in AddJsonOptions

.Net most asked interview questions for experienced professionals (C#,Asp WEBFORM,MVC,ASP CORE,WEB API,SQL Server,Java Script,Jquery)