By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,667 Members | 2,073 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,667 IT Pros & Developers. It's quick & easy.

ajaxtoolkit - slider control not rendering from ajax tab control

P: 1
Hi Folks,

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
  1. Dim tbl As Table = New Table() 
  2. tbl.Width = System.Web.UI.WebControls.Unit.Percentage(100)
  3.  
  4. For i As Integer = 0 To 2 
  5. Dim tr As TableRow = New TableRow()
  6.  
  7. Dim scell As TableCell = New TableCell() 
  8. Dim txtSlider As TextBox = New TextBox()
  9.  
  10. txtSlider.ID = "txt" & i txtSlider.Style.Add("right", "0px") 
  11. txtSlider.AutoPostBack = "true"
  12.  
  13. txtSlider.Height = WebControls.Unit.Pixel(15)
  14.  
  15. 'scell.CssClass = "scoreGrid"
  16.  
  17. scell.Controls.Add(txtSlider)
  18.  
  19. Dim sbCell As TableCell = New TableCell()Dim txtSlider_Bound As TextBox = New TextBox() 
  20. txtSlider_Bound.Width = WebControls.Unit.Pixel(30)
  21.  
  22. txtSlider_Bound.Height = WebControls.Unit.Pixel(15)
  23.  
  24. 'txtSlider_Bound.ReadOnly = "true"
  25.  
  26. txtSlider_Bound.AutoPostBack = "true"
  27.  
  28. txtSlider_Bound.ID = "txtBound" & i 
  29. txtSlider_Bound.Text = i
  30.  
  31. AddHandler txtSlider.TextChanged, AddressOf txtSlider_TextChanged 
  32. sbCell.Controls.Add(txtSlider_Bound)
  33.  
  34. Dim extender As AjaxControlToolkit.SliderExtender = New AjaxControlToolkit.SliderExtender() extender.ID = "ext" & i 
  35. extender.Minimum = "0"
  36.  
  37. extender.Maximum = "100"
  38.  
  39. extender.Steps = "0"
  40.  
  41. extender.Length = 500
  42.  
  43. extender.RaiseChangeOnlyOnMouseUp = "true"
  44.  
  45. extender.BehaviorID = txtSlider.ID
  46.  
  47. extender.TargetControlID = txtSlider.ID
  48.  
  49. extender.BoundControlID = txtSlider_Bound.ID
  50.  
  51. extender.Orientation = AjaxControlToolkit.SliderOrientation.Horizontal
  52.  
  53. extender.EnableHandleAnimation = "true"
  54.  
  55. extender.HandleCssClass = "Slider_handle"
  56.  
  57. extender.RailCssClass = "slider_rail"
  58.  
  59. extender.HandleImageUrl = Server.MapPath("~/Images/slider_h_handle.gif") 
  60. sbCell.Controls.Add(extender)
  61.  
  62. tr.Controls.Add(scell)
  63.  
  64. tr.Controls.Add(sbCell)
  65.  
  66. tbl.Rows.Add(tr)
  67.  
  68. Next
  69.  
  70. ph.Controls.Add(tbl)
Oct 30 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.