We help IT Professionals succeed at work.

ASP.Net Server Control from a ASCX control?

sbornstein2 asked
Hello all,

I have a ASCX control that is using Telerik controls on it a RadGrid with a RadWindow popup.   I have to convert this to a server control but I have very little server control experience.   Pretty much want properties etc in the code.  I am not sure how to handle creating the controls in the server control etc. for the grids etc.   Any advice on where to start or a way to easily convert a ascx to a server control?
Watch Question

tough one...I dont think there is any code that can do it programmatically, read more:


So I am coding this now as a server control.  One question I have is I am using the rendercontents and I can render the basic HTML markup and controls I have added.  However, I have a RadWindow that has in it such as:

   <telerik:RadWindow ID="searchWindow" runat="server" Title="Searcn"
            Width="650px" Height="600px" Behaviors="None" ReloadOnShow="true"
            Modal="true" Skin="Windows7">
            <telerik:RadAjaxPanel id="panel1" runat="server" LoadingPanelID="AjaxLoadingPanel1">
            <div style="padding:5px 5px 5px 5px;">
            ......etc all my content
            .....then closing tags such as

So I have instantiated all the main controls like RadWindow etc. such as:
 protected override void RenderContents(HtmlTextWriter output)

but I am not sure how to have those opening surrounding controls such as the RadAjaxPanel or even just like an UpdatePanel then have the content and then the close tag.   Any idea?  I have everything else I need for the rendercontents figured out it seems but this is confusing because its within a open and close tag for content areas and has to layout exactly as shown above for the Ajax to work.