Xtreme Visual Basic Talk

Xtreme Visual Basic Talk (http://www.xtremevbtalk.com/)
-   ASP.Net (http://www.xtremevbtalk.com/asp-net/)
-   -   AjaxControlToolkit.CalendarExtender (http://www.xtremevbtalk.com/asp-net/326103-ajaxcontroltoolkit-calendarextender.html)

Roger-U 06-21-2013 10:00 AM

AjaxControlToolkit.CalendarExtender
 
Dim cal1 As New AjaxControlToolkit.CalendarExtender
cal1.TargetControlID = "txt3"
Me.Controls.Add(cal1)

but i want (need) to add the <inputs etc as dynamic html such as

litHtml.text = "<input id=""txt3"" />"

This compiles and looks good... but at run time it errors with the calendar control script complaining that element 'txt3' does not exist.

It does, in that document.getelementById("txt3") works, but i guess the CalendarExtender is looking elsewhere for it.

Does anyone know if it is possible to associate the Calendar Extender with a dynamically generated input box?

PlausiblyDamp 06-21-2013 04:04 PM

Never tried doing it dynamically with the Ajax control toolkit, however if you are willing to consider switching to jQueryUI instead then this becomes pretty trivial as you just need to make sure the html element has a specific css class (of your choosing) and it will just work.

Roger-U 06-23-2013 02:12 AM

Thanks for the suggestion, but my client wanted to stick with the Ajax one because they already use it... even if they do complain it doesn't alwyas work reliably!

I did get it going, but it is SUCH A PAIN.. i will have to do some arm bending...!

I did look quickly at http://jqueryui.com/datepicker/ looks like the standard .net webcontrol ... and the immediate issue there is there is no obvious way of going back say 50+ years (except clicking the << button 50 times)... I suspect it is hidden in the documentation somewhere

PlausiblyDamp 06-23-2013 03:04 AM

http://jqueryui.com/datepicker/#dropdown-month-year and http://api.jqueryui.com/datepicker/#option-changeYear

Trust me if you are doing a lot of dynamic HTML generation the jQueryUI stuff is a lot easier to work with compared with the AjaxControlToolkit


All times are GMT -6. The time now is 07:22 PM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Optimisation provided by DragonByte SEO v2.0.15 (Lite) - vBulletin Mods & Addons Copyright © 2017 DragonByte Technologies Ltd.
All site content is protected by the Digital Millenium Act of 1998. Copyright©2001-2011 MAS Media Inc. and Extreme Visual Basic Forum. All rights reserved.
You may not copy or reproduce any portion of this site without written consent.