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

LoadControl, Ajax & Skins

1 Answer 160 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Matthew Erwin
Top achievements
Rank 1
Matthew Erwin asked on 01 Apr 2008, 09:35 PM

I think this should be fairly easy to solve and I'm missing something obvious but after combing through the forums and tutorials and not finding a reasonable solution I figured I'd just post the questions.

I have a situation where I am loading controls with LoadControl after the initial page load. I've broken this down into two issues:

  1. Loading the skins

http://www.telerik.com/community/forums/thread/b311D-kbkmc.aspx talks about pointing to the skin directly. I'm using Prometheus and while I suppose I can copy the Skins directory into my application instead of using the embedded skins I'm not thrilled about having thousands of files in source control when they're already in the dll. Is there a simple way to point to the skin directly or otherwise make the application load the skin if I load a control via LoadControl & Ajax AFTER the page has already been presented on the client?

  1. Using Ajax with a control loaded AFTER the page is presented.

Simple scenario -- the page is intially loaded with an asp:Panel that is populated by clicking a button that uses the RadAjaxManager to get the content for the Panel. The content that comes back is from a control that is loaded via LoadControl and of course also contains various Telerik controls. Obvious problem here is that the RadScriptManager and RadStyleSheetManager were present in the original page but that page was already rendered on the client. There doesn't seem to be an obvious way to register the newly loaded control with. I've looked at what feels like 100's of examples of using LoadControl but they all seem to deal with using it prior to the intial page being displayed rather than after an ajax call.

Thanks for all your assistance on this -- it's driving me nuts! :-)

Matt

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 04 Apr 2008, 02:52 PM
Hi Matthew,

Thank you for contacting us and up to your questions:
  1. You do not need to copy the Skin or oder to have them properly render on the page when loaded with ajax. Simply set EnableAjaxSkinRendering=true of the dynamically loaded control. If you are using RadAjaxManager, the only prerequisite is setting the EnablePageHeadUpdate=true
  2. This is automatically handled by the StyleSheetManager as it is with the ScriptManager. If you have scripts that need to be evaluated upon loading the user control - please wrap them in RadCodeBlock or RadScriptBlock.
Hope this helps.
Greetings,
Steve
the Telerik team

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