DateTimeControl inside an UpdatePanel
-
I'm trying to include a DateTimeControl inside an UpdatePanel. However, IE gives 'Error on page' in the lower-left corner of the browser-screen when I click on the calendar-icon, and no calendar for date-selection appears... :( When I'm not using the UpdatePanel, everything works as intended... The DateTimeControl is used in a TemplateField. Initialization-code is the following:
public void InstantiateIn(Control container) { this.calendar = new DateTimeControl(); this.calendar.ShowWeekNumber = true; if (this.date != null) { this.calendar.SelectedDate = Convert.ToDateTime(date); } this.calendar.AutoPostBack = true; this.calendar.DateOnly = true; this.calendar.HoursMode24 = true; this.calendar.LocaleId = 1043; this.calendar.Enabled = this.editMode; this.calendar.ID = ((System.Web.UI.WebControls.TemplateField)((System.Web.UI.WebControls.DataControlFieldCell)(container)).ContainingField).SortExpression + "DateTimeControl"; container.Controls.Add(calendar); }
date is a nullable DateTime-object editMode is a boolean (as is obvious from code) Does anyone have any clue as if and how to get this to work inside an UpdatePanel?Nah... What's up, Doc? CCC's solved : 1 If a bus station is where a bus stops, and a train station is where a train stops, why do I have a work station on my desk?
-
I'm trying to include a DateTimeControl inside an UpdatePanel. However, IE gives 'Error on page' in the lower-left corner of the browser-screen when I click on the calendar-icon, and no calendar for date-selection appears... :( When I'm not using the UpdatePanel, everything works as intended... The DateTimeControl is used in a TemplateField. Initialization-code is the following:
public void InstantiateIn(Control container) { this.calendar = new DateTimeControl(); this.calendar.ShowWeekNumber = true; if (this.date != null) { this.calendar.SelectedDate = Convert.ToDateTime(date); } this.calendar.AutoPostBack = true; this.calendar.DateOnly = true; this.calendar.HoursMode24 = true; this.calendar.LocaleId = 1043; this.calendar.Enabled = this.editMode; this.calendar.ID = ((System.Web.UI.WebControls.TemplateField)((System.Web.UI.WebControls.DataControlFieldCell)(container)).ContainingField).SortExpression + "DateTimeControl"; container.Controls.Add(calendar); }
date is a nullable DateTime-object editMode is a boolean (as is obvious from code) Does anyone have any clue as if and how to get this to work inside an UpdatePanel?Nah... What's up, Doc? CCC's solved : 1 If a bus station is where a bus stops, and a train station is where a train stops, why do I have a work station on my desk?
I've managed to get a little bit further... In my webpart, which uses the template I made for showing and selecting the date, I have two ways to edit an entry. 1) Through details and then edit from a MenuItemTemplate 2) Directly edit through a MenuItemTemplate Using the first method gives me errors (error: Object expected). Using the second method works flawless. The template is called as a template for a templatefield in a detailsview. Anyone have any idea?
Nah... What's up, Doc? CCC's solved : 1 If a bus station is where a bus stops, and a train station is where a train stops, why do I have a work station on my desk?