Calendar in RadDock

3 posts, 1 answers
  1. Andy Ho
    Andy Ho avatar
    41 posts
    Member since:
    May 2010

    Posted 26 Jul 2010 Link to this post

    I use the following code to create a RadDock:

                Dim newdock As RadDock = CreateRadDock()
                Dim WPID as String=Guid.NewGuid.ToString
                newdock.Tag = "Calendar.ascx"
                newdock.DockMode = DockMode.Docked
                newdock.EnableRoundedCorners = True
                newdock.UniqueName = WPID
                newdock.ID = WPID
                LoadWidget(newdock)
                zoneLeft.Controls.Add(newdock)

    The Calednar.ascx only contains a RadCalendar control, nothing else.

    A javascript error "Expected ':' occur when the page start, my other .ascx (without RadCalendar) files works ok. I tried that if the ID is not a GUID (such as Dock01), it will be ok. But I need that as it is a key in my Database.

    Please help.


  2. Answer
    Pero
    Admin
    Pero avatar
    1156 posts

    Posted 26 Jul 2010 Link to this post

    Hello Andy,

    I believe the problem is caused by the following two lines:
    Dim WPID as String=Guid.NewGuid.ToString
    ...............
    newdock.ID = WPID

    "Guid.NewGuid.ToString" returns an ID which contains "-". By default you cannot use strings as IDs of ASP.NET controls that contain the "-" character. So the "-" character should be replaced with a "legal" ASP.NET character. Moreover the Guid can start with a numeric character, which once again is invalid. You should make sure the ID starts with alphabetic character. For an example this line of code should be used instead:

    Dim WPID as String=Guid.NewGuid.ToString.Replace("-","a")
    ...............
    newdock.ID = "RadDock" & WPID


    Greetings,
    Pero
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andy Ho
    Andy Ho avatar
    41 posts
    Member since:
    May 2010

    Posted 26 Jul 2010 Link to this post

    Thanks. It works ok now.
Back to Top