Slider control is driving me nuts, below is the code from my test page's page load event, nothing great about code, I have a place holder control into which I am adding a table which has three rows with a slider control in each row created dynamically. The problems what I have are
1) handler image does not get displayed, I have set the handleImageUrl and have moved the handlecssclass and railcssclass into local style sheet
2) bound control always defaults to 0, instead of displaying 0, 1 and 2 in the three instances as per the loop variable. Though for a breif period it does show 0 ,1 & 2 respectively but gets reset to 0 immediately upon completing load event.
3) When I view source for the aspx, html input tag for the bound textbox has a value other than 0
If I set the value for the textbox which is extended I get error on liine 194 and further proceeding raises error saying handler was not added through dom.addhandler method.
any idea what is causing the problem, your help is greatly appreciated. I am using visual studio 2008, .net 2.0 with ajax tool kit version v1.0.61025
I have not given the entire code, actually the siders will be added to a ajax tab panel in a user control.
Regards,
Santhosh
Expand|Select|Wrap|Line Numbers
- Dim tbl As Table = New Table()
- tbl.Width = System.Web.UI.WebControls.Unit.Percentage(100)
- For i As Integer = 0 To 2
- Dim tr As TableRow = New TableRow()
- Dim scell As TableCell = New TableCell()
- Dim txtSlider As TextBox = New TextBox()
- txtSlider.ID = "txt" & i txtSlider.Style.Add("right", "0px")
- txtSlider.AutoPostBack = "true"
- txtSlider.Height = WebControls.Unit.Pixel(15)
- 'scell.CssClass = "scoreGrid"
- scell.Controls.Add(txtSlider)
- Dim sbCell As TableCell = New TableCell()Dim txtSlider_Bound As TextBox = New TextBox()
- txtSlider_Bound.Width = WebControls.Unit.Pixel(30)
- txtSlider_Bound.Height = WebControls.Unit.Pixel(15)
- 'txtSlider_Bound.ReadOnly = "true"
- txtSlider_Bound.AutoPostBack = "true"
- txtSlider_Bound.ID = "txtBound" & i
- txtSlider_Bound.Text = i
- AddHandler txtSlider.TextChanged, AddressOf txtSlider_TextChanged
- sbCell.Controls.Add(txtSlider_Bound)
- Dim extender As AjaxControlToolkit.SliderExtender = New AjaxControlToolkit.SliderExtender() extender.ID = "ext" & i
- extender.Minimum = "0"
- extender.Maximum = "100"
- extender.Steps = "0"
- extender.Length = 500
- extender.RaiseChangeOnlyOnMouseUp = "true"
- extender.BehaviorID = txtSlider.ID
- extender.TargetControlID = txtSlider.ID
- extender.BoundControlID = txtSlider_Bound.ID
- extender.Orientation = AjaxControlToolkit.SliderOrientation.Horizontal
- extender.EnableHandleAnimation = "true"
- extender.HandleCssClass = "Slider_handle"
- extender.RailCssClass = "slider_rail"
- extender.HandleImageUrl = Server.MapPath("~/Images/slider_h_handle.gif")
- sbCell.Controls.Add(extender)
- tr.Controls.Add(scell)
- tr.Controls.Add(sbCell)
- tbl.Rows.Add(tr)
- Next
- ph.Controls.Add(tbl)