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

Add controls to a page via .ashx

3 Answers 75 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matt Dawdy
Top achievements
Rank 1
Matt Dawdy asked on 29 Apr 2010, 11:22 PM
I've got a real need to be able to, from a client page, call a .ashx handler in my site, and have it return a bunch of html, including some telerik controls like textboxes, drop down boxes, masked edit type things, etc.

However, I've tried faking a page and adding rad controls to it and then getting the resulting html, but that tells me I need a script manager.  I've tried adding one in, but that tells me the helpful message of Object isn't instantiated...

Is there any good way that I can create controls without having a full .aspx page?

3 Answers, 1 is accepted

Sort by
0
Dimitar Milushev
Telerik team
answered on 30 Apr 2010, 03:15 PM
Hello Matt,

You should set RegisterWithScriptManager = false; to all controls that are in the fake page.

Kind regards,
Dimitar Milushev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Matt Dawdy
Top achievements
Rank 1
answered on 03 May 2010, 08:25 PM
Thank you so much.  That worked very well.  The only problem I see currently is that a textbox that contains a mask for a phone number now isn't acting like a masked textbox.  Is there any way to apply this functionality after the controls are added to a page (the page has already been rendered -- we are dropping in a block of html that contains some rad controls after some user interaction -- these can and do change from 1 page load to another).
0
Dimitar Milushev
Telerik team
answered on 07 May 2010, 12:30 PM
Hello Matt,

The masked textbox relies on Javascript to work and when a block of html is simply inserted into the Page, the Javascript in this block of html is not evaluated or executed.

One alternative that you can try is to use the RadXmlHttpPanel - it has the ability to evaluate Javascript returned from a WebService.

Greetings,
Dimitar Milushev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Matt Dawdy
Top achievements
Rank 1
Answers by
Dimitar Milushev
Telerik team
Matt Dawdy
Top achievements
Rank 1
Share this question
or