Welcome Guest Search | Active Topics | Sign In | Register

Slider ServerSide event "onchanged" Options
LHSoft
Posted: Friday, November 2, 2012 10:51:56 PM
Rank: Member
Groups: Member

Joined: 12/12/2010
Posts: 12
Hello,

I want to use the server side slider event "onchanged", but it does not fire when moving then Thumb with mouse:

<%@Page ...
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<html>
<head>
</head>
<body>
<form id="form1" runat="server">
<div>
<eo:Slider runat="server" ID="Slider1" ....
onchanged="Slider1_Changed"
....
</eo:Slider>
</div>
</form>
</body>
</html>

in code:
public void Slider1_Changed(object sender, EventArgs e)
{
//do something;
}

Is this a bug or is something missing?

best regards
Hans
eo_support
Posted: Friday, November 2, 2012 11:14:40 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

Have you tried to set AutoPostBack to true?

Thanks!
LHSoft
Posted: Saturday, November 3, 2012 4:46:20 AM
Rank: Member
Groups: Member

Joined: 12/12/2010
Posts: 12
Hello,

I thought about and was looking for autopostback, but I am missing this property, cant find it.

There is no property AutoPostBack, neither in slider nor in sliderbase class.

I tried:
Slider.Attributes.Add('AutoPostBack', 'True'); : no result.

best regards
Hans
eo_support
Posted: Saturday, November 3, 2012 9:30:44 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

We misunderstood it as Slide control instead of Slider control. Slider control does not have AutoPostBack. A Slider's OnChange event only occurs when the whole page posts back. For example, if you change the Slider value, then click "Submit" button, you will see the Slider's OnChange event fire. This is very similar to a TextBox's OnChange event. It fires on post back, not when it occurs.

Thanks!
LHSoft
Posted: Saturday, November 3, 2012 2:11:03 PM
Rank: Member
Groups: Member

Joined: 12/12/2010
Posts: 12
Hello,

you answer is not 100% correct.

Please remember, that there is a autopostback property at Textbox so that the onchange event is fired when changing text without clicking a separate button for postback.

Do have a look at ajax's standard slider control. There is a way to initiate autopostbacks over the onchanged event of the assoziated, not visible Targetcontrol combined with the property "RaiseChangeOnlyOnMouseUp". This works very fine. Your Slider does have the advantage of fine styling possibilities and it would be nice if it would have the possibilities of standard behavior of ajax slider for users to have the feeling of modern .net programming.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.