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

Usercontrol javascript missing/error

1 Answer 99 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
tlp
Top achievements
Rank 1
tlp asked on 07 Jul 2008, 11:11 AM

I’m in the process of converting our web application from RadControls for ASP.NET to the new RadControls for ASP.NET AJAX. The application has been configured to use ASP.NET AJAX and things seem to be working fine. Although, I have encountered a scenario that does not seem to work with the new AJAX controls but had worked previously.

Basically, there is a page with a grid control that allows editing using a user control. The user control contains a RadWindow control and some javascript to open the RadWindow.

There is a button on the user control that is used to execute the script to open the RadWindow using an AJAX request (ResponseScripts.Add(...)). When the grid is in edit mode and the button is clicked to open the RadWindow, the following JavaScript error is thrown:

“Microsoft JScript runtime error: Object expected”

It seems like the RadWindow control and the javascript within the user control are ignored when the user control is rendered on the page. The javascript within the usercontrol is wrapped within a “RadCodeBlock” tag. Viewing the source for the page shows that the javascript is missing. 

Any help in resolving the above issue would be greatly appreciated. 


Thanks in advance,

Tony

 

1 Answer, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 10 Jul 2008, 11:24 AM
Hello tlp,

You can try using ScriptManager.RegisterClientScriptBlock method instead to register the client scripts. I attached a sample project that demonstrates this approach - please use it for further reference.

Greetings,
Rosen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Ajax
Asked by
tlp
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or