code below:
// Create a textbox to hold the date
TextBox dateValue = new TextBox();
dateValue.ID = "dateValue";
// Create the calendar extender
AjaxControlToolkit.CalendarExtender ajaxCalendar =
new AjaxControlToolkit.CalendarExtender();
ajaxCalendar.ID = "ajaxCalendar";
ajaxCalendar.Format = "MM/dd/yyyy";
ajaxCalendar.TargetControlID = dateValue.ID;
placeHolder1.Controls.Add(dateValue);
placeHolder1.Controls.Add(ajaxCalendar);
In the ASPX, I have just a simple PlaceHolder where I append the dynamically created controls:
<asp:placeholder id="placeHolder1" runat="server">
asp:placeholder>
Please see picture below:
how to ajax extender for multiple textboxes created dynamically
ReplyDelete