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

Problems with DatePicker inside a WebUserControl

6 Answers 124 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
FELIX MELENDEZ
Top achievements
Rank 1
FELIX MELENDEZ asked on 17 Sep 2009, 09:40 PM

Hi there,

I'm testing ASP.NET AJAX UI Controls and specially the DatePicker.  I have two Date Pickers in a web user control. Then I have a content page onto which I place the aforementioned web user control. As you might guess this last content page has its master page. So the hierarchy is as follows

master page
   content page
      web user control (this one has the 2 date pickers)

Question:
Why when I want to access my web page, I see both date pickers rendered but as soon as I clic on the date icon a JavaScript error shows in the left-lower browser's corner. I've been investigating the reason for this with no success :-(..

Please if some one could shed some light on this (show some code example).
Felix

6 Answers, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 23 Sep 2009, 01:08 PM
Hi FELIX,

I made a sample project for you implementing your scenario. It is working fine on my side - no errors are shown. Please take a look at it and tell me whether it works for you.

Greetings,
Mira
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
FELIX MELENDEZ
Top achievements
Rank 1
answered on 23 Sep 2009, 02:53 PM
Mira,

Thanks for answering my email. I looked at your sample you sent me and indeed it gives no error but it's not what I want. I'd like to attach the same solution you sent me where I added my error as well (so that you can take a look at it). But... how do I attach the file to this message? I see no attach icon! :-(

If you need more info or have any questions, please notify me asap.

Have a nice day, and thanks for your assistance.
Felix
0
Mira
Telerik team
answered on 25 Sep 2009, 11:56 AM
Hi Felix,

In the forums it is not allowed for customers to attach files. To send us your project please open a regular support ticket and attach the project. We will debug it locally and get back to you with our findings.

Kind regards,
Mira
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Steven
Top achievements
Rank 1
answered on 27 Oct 2009, 10:41 AM
I have this exact same problem, was a fix found from the ticket?
0
Steven
Top achievements
Rank 1
answered on 28 Oct 2009, 10:40 AM
Well I gave up using the Telerik DatePickerin the end, it doesn't seem to be usable from within my user control, definitely seems to have issues with scripts.  I tried using RegisterWithScriptManager this morning but it made no difference.

For now I have used a calendar extender from the AjaxToolKit but I would prefer to have used the Telerik DatePicker so the application was more consistant.  Maybe when they get this bug fixed that will be possible.  I have included what I used as a work around below:

Dim rdp = New TextBox 
rdp.ID = ControlID 
 
Dim rdpext = New AjaxControlToolkit.CalendarExtender 
rdpext.ID = "CalExt" & ControlID 
rdpext.TargetControlID = ControlID 
 
Control.Controls.Add(rdp) 
Control.Controls.Add(rdpext) 

0
Felix Ruben Melendez Batres
Top achievements
Rank 1
answered on 28 Oct 2009, 06:46 PM
Steven,

It's good to know that some other person has gone through this problem as well. Please don't get me wrong but some times when some one reads the documentation, such samples do not reflect necessarily the same as one's problem want to solve. Instead you have to dig for more information. I can assure that RadControls are the best out there it's just a matter of "playing" with them to get to know them (but takes lot of time).
 
Back to the issue, I had to do all the programming from the code-behind and finally got it working. I don't know but in a previous post I asked how  a customer could upload files (so that any one can peek at the code) and I had to open some "ticket", etc. Since I had the pressure to make it work, I gave it up and opted to solve the problem. But I don't know how or why, but for some reason now I'm looking at the UploadFile control so I'll post right away a sample of my solution. Hope anyone find it useful and if for some reason some one can make it better, please share it as well.

Just 2 things to do on your part
1) please copy the following files to the bin directory (since I got a maximum of 2MB max total size according to Telerik forums):
Telerik.Web.UI.dll (since it's about 13MB and the solution compressed was 4MB).
2) rename the attached file which has an extension of .jpg to .rar (and then decompress it).

If any one has any question, please feel free to ask.

Have a nice day to all of you,
Felix
Tags
Calendar
Asked by
FELIX MELENDEZ
Top achievements
Rank 1
Answers by
Mira
Telerik team
FELIX MELENDEZ
Top achievements
Rank 1
Steven
Top achievements
Rank 1
Felix Ruben Melendez Batres
Top achievements
Rank 1
Share this question
or