I’d like to use an ajaxToolkit:CalendarExtender on an asp:Label. When I attach a CalendarExtender to the label, I get the error:
Extender controls of type
‘AjaxControlToolkit.CalendarExtender’
cannot extend controls of type
‘System.Web.UI.WebControls.Label’.
I’m hoping someone knows a quick trick to allow me to display a date in a label and allow that label to be clicked to trigger/open a CalendarExtender which might target a hidden asp:TextBox… if that’s possible.
As the error states, the Calendar extender is constrained to extend only textbox controls by default.
Looking at the ASP.NET AJAX Control toolkit page for the Calendar extender, you should be able to use the
PopupButtonIDto enable the label to trigger the calendar popup (you’ll need to add in the unhiding of the textbox too).