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

Embed DatePicker into a web user control?

5 Answers 121 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
a
Top achievements
Rank 1
a asked on 09 Jul 2008, 02:03 PM
I have a RadDatePicker in a web user control (.ascx file).  I then have that web control registered on my Default page...  But the Date Picker Errors out.

I'm guessing it has something to do with inheritance? not sure though...

and yes I have the script manager registered also


5 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 09 Jul 2008, 02:11 PM
Hi a,

Can you post a bit more info about the error?

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
a
Top achievements
Rank 1
answered on 09 Jul 2008, 02:21 PM
the error in the error list is as follows

Unknown server tag 'telerik:RadDatePicker'.


now if I just add the datepicker directly into my Defalut.aspx page then everything works fine.  It give the above error when the Datepicker is inside the user control file (.ascx) and then that is registered and added into the Default.aspx page

Also...  at the top of my Default page I have the telerik assembly registered...

when I add the date picker into my .ascx file it again registers the telerik assembly within the .ascx file BUT that errors out because then you have it registered 2 times...  so I removed the register assembly from the .ascx file at the top.


0
a
Top achievements
Rank 1
answered on 09 Jul 2008, 02:34 PM
you know, it almost seems to be the same problem as this senario...

Lets say I have a Radcontrol in a masterpage (so the telerik assembly and namespace is registered in the masterpage header.

Then on my content page (lets say default.aspx) I also have a RadControl...  so then it tries to register the assembly and namespace again on the default page...  which leads to the error of having it registered 2 times...  If I remove the declairation from the default page then it doesn't know what the RadControls on the default page are?

Could this be solved by simply changing the namespace to differ on the master/default pages to something not the same...  And respectively changing the controls?

0
Accepted
Vlad
Telerik team
answered on 09 Jul 2008, 02:39 PM
Hello a,

I have attached small example to illustrate you how to achieve your goal.

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
a
Top achievements
Rank 1
answered on 09 Jul 2008, 04:07 PM
I believe the problem was that I was using the RadScriptManager.  In the example above it used the asp script manager.  Once I switched them out and got a new web.config it worked fine.

Thanks for the help!
Tags
General Discussions
Asked by
a
Top achievements
Rank 1
Answers by
Vlad
Telerik team
a
Top achievements
Rank 1
Share this question
or