Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. SharePoint
  4. DateTimeControl inside an UpdatePanel

DateTimeControl inside an UpdatePanel

Scheduled Pinned Locked Moved SharePoint
designdockerhelptutorialquestion
2 Posts 1 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    S Brozius
    wrote on last edited by
    #1

    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?

    S 1 Reply Last reply
    0
    • S S Brozius

      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?

      S Offline
      S Offline
      S Brozius
      wrote on last edited by
      #2

      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?

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups