This is a migrated thread and some comments may be shown as answers.

Calendar in RadDock

2 Answers 32 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Andy Ho
Top achievements
Rank 1
Andy Ho asked on 26 Jul 2010, 07:33 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Pero
Telerik team
answered on 26 Jul 2010, 09:10 AM
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
0
Andy Ho
Top achievements
Rank 1
answered on 26 Jul 2010, 09:30 AM
Thanks. It works ok now.
Tags
Dock
Asked by
Andy Ho
Top achievements
Rank 1
Answers by
Pero
Telerik team
Andy Ho
Top achievements
Rank 1
Share this question
or