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

Dynamic Telerik Controls on a Nested User Control

1 Answer 19 Views
AJAX and Web 2.0
This is a migrated thread and some comments may be shown as answers.
uzairtahir
Top achievements
Rank 1
uzairtahir asked on 29 Jan 2013, 09:45 AM

I am trying to add Telerik’s controls (like RadMaskedTextBox, RadNumericTextBox and RadDateInput controls) dynamically into a user control (under the Page_Init event) which is itself a child of another user control.

 

When I run the project, following exception occurred and nothing is shown in the user control.

“Microsoft JScript runtime error: Sys.ArgumentException: Value must not be null for Controls and Behaviors. Parameter name: element”

 

However, these controls are added directly on a .aspx page without any exception and it appeared that the Telerik’s controls get registered in the Page_PreRenderComplete event of an .aspx page and since this event does not exist in a user control therefore they are throwing the above exception.

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 01 Feb 2013, 11:51 AM
Hi Uzairtahir,

We have tested adding dynamically these controls inside an UserControl during the Page_Init and it is working correct. If you have troubles with doing this, it is caused by something custom in your code, it is hard to say why you are facing the issue without having additional information or runnable version of your Page. If you give us more details on your project, or insulate it inside sample page, we will try to provide you further information.

Greetings,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
AJAX and Web 2.0
Asked by
uzairtahir
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Share this question
or