ラベル slider の投稿を表示しています。 すべての投稿を表示
ラベル slider の投稿を表示しています。 すべての投稿を表示

2012年3月26日月曜日

Restrict slider from moving past maximum value

Hi,

I am very new to the ajaxcontrol toolkit. I need to implement a slider for one of my projects at school. I created a simple <sliderextender> and bound it to a textbox as shown in the example. For some reason, when I run it, the slider is able to slide past the maximum value and keeps sliding. Anyone seen this before? Below is the code:

<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %
<%@dotnet.itags.org. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />

<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:TextBox ID="slider1" runat="server" />
<asp:TextBox id="sliderbound1" runat="server" Width="30" />
<cc1:SliderExtender ID="SliderExtender1"
runat="server"
Minimum="0" Maximum="100" EnableHandleAnimation="true"
Orientation="Horizontal" TargetControlID="slider1" BoundControlID="sliderbound1">
</cc1:SliderExtender>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>

Hi,

the reason is an old issue whose fix has not been yet propagated to the release branch :(

If you download one of the latest development branch from here, the issue should be resolved.

If you have downloaded the source code for the latest release:

1. Go to Slider/SliderBehavior.js

2. Find this line (lineno 323 in my file): this._handleAnimation = new $AA.LengthAnimation( ...

3. Replace $AA with: AjaxControlToolkit.Animation

4. Recompile the source code


Hi Garbin,

Thanks a bunch, the fix worked like a charm :)

Thanks,

Praveen


2012年3月24日土曜日

Reverse direction of veritcal slider?

Is it possible to reverse the direction of the slider extender? I'm using it vertically and would like the higher maximum value to be the top of the slider and the minimum value to be the bottom of the slider.

Hi,

what you can do is using negative numbers and then take the absolute value. For example, setting Minimum="-20" and Maximum="40" and then taking the absolute value of the slider. The problem is that if you use a bound control to display the slider's value, it will display the negative sign.

This scenario will be addressed in the next release, so thank you for reporting this.