Often times, I have encounter questions regarding dynamically creating controls, specifically ones related to the ASP.NET AJAX Control Toolkit. Today, I was working with an application where I needed to create a dynamic CalendarExtender and thought I would post the results.
Here is a simple example of how to create a dynamic CalendarExtender from code-behind:
In the ASPX, I have just a simple PlaceHolder where I append the dynamically created controls:
Finally, here’s the end result: