We help IT Professionals succeed at work.

ASP.Net Server Control from a ASCX control?

sbornstein2
sbornstein2 asked
on
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?
Comment
Watch Question

Programmer
Commented:
tough one...I dont think there is any code that can do it programmatically, read more:
http://forums.asp.net/t/1238491.aspx/1

Author

Commented:
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">
            <ContentTemplate>
            <telerik:RadAjaxPanel id="panel1" runat="server" LoadingPanelID="AjaxLoadingPanel1">
            <contenttemplate>
            <div style="padding:5px 5px 5px 5px;">
            ......etc all my content
            .....then closing tags such as
  </div>
            </contenttemplate>
            </telerik:RadAjaxPanel>
        </ContentTemplate>
            </telerik:RadWindow>

So I have instantiated all the main controls like RadWindow etc. such as:
 protected override void RenderContents(HtmlTextWriter output)
        {
  this.RadWindowManager1.RenderControl(output);
  this.searchWindow.RenderControl(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.

Author

Commented:
thanks