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

User Control implementing IScriptControl with several Rad controls

3 Answers 33 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Troy
Top achievements
Rank 1
Troy asked on 19 Dec 2011, 08:06 PM
I have a user control that I've implemented IScriptControl on to allow the addition of a client side api to the control.  The user control contains a few RadComboBoxes.  Everything is almost working, however, during the initial page load my client side dispose method is called, which in-turn causes a client side error in the RadScriptManager client side code in CreateCallback with error a is undefined.  

We have a master page that is being used, which contains the RadScriptManager.

I'm sure I'm just missing something, but any help you can provided would be greatly appreciated.

3 Answers, 1 is accepted

Sort by
0
Troy
Top achievements
Rank 1
answered on 20 Dec 2011, 01:17 PM
After further debugging, the error appears to occur in Sys.UI.Control=function(a){Sys.UI.Control.initializeBase(this);this._element=a;a.control=this}
0
Troy
Top achievements
Rank 1
answered on 20 Dec 2011, 01:40 PM
I am new to using IScriptControl, so please forgive the shortcomings.

It appears that the element passed to my javascript constructor is null because the clientID of my user control does not actually end up on the page.

Can someone please help me out here?
0
Troy
Top achievements
Rank 1
answered on 20 Dec 2011, 02:24 PM
I have resolved the issue.  The issue was that the clientId for the UserControl is not rendered to the page, only the child items.  So, the $find could not find my userControl by it's clientId.

I simply added code the Render method to wrap the control in a div with the UserControl's clientId as the Id.
Tags
General Discussions
Asked by
Troy
Top achievements
Rank 1
Answers by
Troy
Top achievements
Rank 1
Share this question
or