Hi,
thanks for posting a repro. I'm going to investigate this issue.
Which version of the Toolkit are you using? The one released with MS AJAX Beta1 or the September release?
Also, is the issue remaining if you don't hide the Panel in which the slider is contained?
Thanks.
Hi Garbin,
I'm using the September release of the toolkit (I notice that another one has just been released, so I'm not sure if this may fix the problem - I'll test it).
I also tried it when the Panel containing the slider isn't hidden, and the problem still occurs.
I have actually managed to fix the problem by changing the 'set_Value' function in the slideBehaviour.js, as shown below, although I'm not sure why 'this.control' would be null the 2nd time round.
Thanks for your help with this,
Steve
this.set_Value = function(value) {
if(value != _value) {
_value = (value < _minimum) ? _minimum
: (value > _maximum) ? _maximum
: value;
if(isNaN(_value)) {
_value = _minimum;
}
_value = Number.parse(_value.toFixed(_decimals));
if(_isInitialized&& this.control )
{
this.control.set_text(_value);
if(!_isUpdatingInternal)
{
this._setHandleOffset(_value,_enableHandleAnimation);
}
this._ensureBinding();
}
this.raisePropertyChanged('Value');
this.ValueChanged.invoke(this, Sys.EventArgs.Empty);
}
}
Hi,
thanks. Please try to build a simple example with the latest Toolkit release and let me know if it happens again.
Hi Garbin,
I've rebuilt everything with the latest ASP.NET Ajax stuff (i.e. no more Atlas) and the good news is that the crash has now gone away.
The bad news is that I now get a new crash - if I have EnableHandleAnimation="true"on the SliderExtender then I get the following error: "Microsoft JScript runtime error: '$AA' is undefined" (it works ok if I don't enable handle animation). This happens on the very simplest of pages, with no other ajax components:
<%@.PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default"%>
<%@.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="ajaxToolkit"%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server"><title>Untitled Page</title></head>
<body>
<formid="form1"runat="server">
<div>
<asp:ScriptManagerID="ScriptManager1"runat="server"/>
<asp:TextBoxID="txtSlider"runat="server"Text="5"/>
<asp:TextBoxID="txtBoundSlider"runat="server"Width="21"/>
<ajaxToolkit:SliderExtender
ID="sliderExt"
runat="server"
TargetControlID="txtSlider"
BoundControlID="txtBoundSlider"
Maximum="10"
Minimum="0"
Orientation="Horizontal"
EnableHandleAnimation="true"/>
</div>
</form>
</body>
</html>
Steve
Hi,
this is strange because the sample page athttp://ajax.asp.net/ajaxtoolkit/Slider/Slider.aspx is working correctly. I'll investigate that.
Hi,
this issue has been fixed in the last change set.
Fix:
1. Browse to AjaxControlToolkit/Release/Slider/SliderExtender.cs
2. Just before the SliderExtender class declaration, replace:
[RequiredScript(typeof(Animation))]
with:
[RequiredScript(typeof(AnimationScripts))]
Thanks.
Hi Garbin,
That's fixed the problem thanks - the $AA error has gone and the slider seems to be working fine now in the UpdatePanel with the latest Ajax stuff.
One minor issue that I have now is that the slider loses its value when the UpdatePanel is refreshed. With the code below the slider begins with a value of 5. Clicking the button to refresh the UpdatePanel results in the slider moving to position 0 (although if the SliderExtender is removed, the TextBox maintains its value of 5). Should I be doing something different to retain the slider's value when the UpdatePanel is refreshed?
Thanks for all your prompt help with this,
Steve
<%@.PageLanguage="C#"%>
<%@.RegisterAssembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="Microsoft.Web.UI"TagPrefix="asp"%>
<%@.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="ajaxToolkit"%>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<scriptrunat="server">
protectedvoid Button2_Click(object sender,EventArgs e ){}
</script>
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server"><title>Untitled Page</title></head>
<body>
<formid="form1"runat="server">
<asp:ScriptManagerID="ScriptManager1"runat="server"/>
<asp:UpdatePanelID="UpdatePanel1"runat="server"UpdateMode="Conditional">
<ContentTemplate>
<asp:PanelID="Panel1"runat="server"Height="50px"Width="125px"BackColor="Aqua">
<asp:TextBoxID="txtSlider"runat="server"Text="5"/>
<asp:TextBoxID="txtBoundSlider"runat="server"Width="21"/>
<ajaxToolkit:SliderExtenderID="sliderExt"runat="server" TargetControlID="txtSlider"
BoundControlID="txtBoundSlider"Maximum="10"Minimum="0"Orientation="Horizontal"
EnableHandleAnimation="true"/>
<asp:ButtonID="Button2"runat="server"Text="Close"OnClick="Button2_Click"Width="155px"/>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>
Hi,
the migration process introduced some issues that I've fixed in development builds. Hopefully they'll be included soon in a Toolkit refresh.
In the meanwhile, try to apply this fix:
http://forums.asp.net/thread/1437024.aspx
and let me know if it works.
Hi Garbin,
I just made those changes to the JS and it's fixed the problem - so, as far as I can tell, everything is now working as it should.
Thanks again for all your help with this.
Steve
Hi Garbin,
I think I've found another minor problem with the slider - it doesn't appear to have a linear scale. For example, in the code I've been using on this thread, the minimum value is set to 0 and the maximum to 10, however as the slider is moved from right to left, the bound control shows 0 before the slider has moved to the very edge. The problem can be made more severe if the maximum value is set to 2; in this case the bound control shows 0 when the slider reaches the half way point. It seems as if 2 divisions on the slider's track are being allocated to the 0 value.
Steve
Hi,
The Bugs above are still in the new Release 61106 (Beta 2).
should I do this changes in every release? ;)
thx!
Hi,
hopefully not. I think the fixes will be available in the next refresh (btw, the above issues are already fixed in development releases).
Thanks for your patience.
No comments:
Post a Comment