Using a server control in the rendering a custom control


I have a custom control that overrides the Render method to draw itself.  Is it possible to use a server control (asp:Image, wwHoverPanel, etc.) inside such a custom control or would I have to rewrite my custom control as a composite control?

I'd like to do something something like:

protected override void Render(HtmlTextWriter w)

   // somehow place asp:Label here

   w.RenderEndTag(); // column
   w.RenderEndTag(); // row
   w.RenderEndTag(); // table

The control in question is pretty complicated and rewriting it as a composite control would take a fair amount of work.



2/15/2007 11:10:54 PM 3498 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 30
Get it on Google Play
Get it on Apple App Store

Yes, it is possible
Whatever way which you choose
Guennadi Vanine - Gennady Vanin - Геннадий Ванин
2/18/2007 1:33:18 AM

Similar Artilces:

how to have both server controls and html controls rendered in a custom control?
I have a custom control in which there is an html text box.when you click on it , a div containing a table is appeared and according to what you select in that table a text is set to the text box. It works fine but the problem is: as the text box is an html element it doesn't have viewstate and when a post back occures in the page its value disappeares.I tried a hidden field to keep its value.again there is another problem : I put this custom control in a usercontrol and put the usercontrol in a multiview and by clicking on a button this view is selected and by clicking another bu...

Usercontrol vs Custom Server Controls, Any need for Custom Server Controls
Hello I'm new to ASP.Net so this is probably a stupid question but, is there any need to create customer server controls now that you can pre-compile usercontrols into a dll and thus easily share between applications? This blog post from David Ebb describes how to do it and the restrictions he note don't seem that bad (other than being able to embed resources such as images in the dll). His article desribes the techniques for ASP.Net 2.0 and he suggests that there will be further improvements in .Net 3.5 in this ar...

Custom Server Control Vs Web Parts, Any need for Custom Server Control
Hello I've just posted a similar question on why you need server controls when you can pre-compile usercontrols and redistribute them. I've seen lots of (usercontrol vs web part) but not much on web part vs custom server control. According to the MSDN site you can put web parts onto a normal page outside of a web part zone and they behave just like custom server controls. So, if you are creating a bunch of controls for redistribution to customer sites and/or SharePoint sites why don't you just create Web Par...

problems listenening to events on a custom server control from another custom server control
 Hi all,I am having problems listening to events on one of custom server controls(AddBookmark) from another custom server control(BookmarkList). The listener or the BookmarkList control has a property that can be set to the AddBookmark control (string at design but the reference is obtained at run-time). I am able to get a reference to the AddBookmark control and add a listener to it on the BookmarkList control on the OnPrender of BookmarkList. But the problem is that when the events on AddBookmark gets fired, the listener added from the BookmarkList is no longer present and the listene...

Custom Server Control Made of Custom Controls?
I'm giving myself a crash course in custom server controls, and I have a quick general question. Can I have a custom server control that is composed of other server controls I created. I'm pretty sure the answer is yes, but I want to be positive. Yes Shows how to combine existing controls into a new control using class composition. -ron Thanks! ASP.NET so rocks! Making page components extensible objects is such a great idea! I love it....

Custom Server Control to render multiple Controls
I have a need to build a reusable "Custom Server Control" that will in turn render multiple controls at runtime. The four controls I need it to render are as follows  <asp:Label ID="divLogin" runat="server" Text=" | " /> <asp:LoginStatus CssClass="footer" ID="LoginStatus1" runat="server" LogoutPageUrl="Default.aspx" /> <asp:Label ID="divAdmin" runat="server" Text=" | " /> <asp:HyperLink CssClass="footer" ID="btnAdmin" NavigateUrl=&...

Using a user control in a custom server control.
I've created a custom server control and am trying to add a user control to the rendering of the server control.  Is this possible?  If so, hints as to how this is done would be GREATLY appreciated!  Thanks in advance for considering an answer to this question. Wendi Use the LoadControl method. For example:   Controls.Add(LoadControl("~/controls/login.ascx"))Steven BeyRecursion: see Recursion My server control renders a table with x number of rows.  I want to add a user control to each row of the table, last column.  I do not know how ...

How to render a repeater control in the custom server control?
 How to render a repeater control in the custom server  control because there is a lot of element inside the repeater control? My code is as follows: <div> <asp:Repeater ID="rptFields" runat="server"> <HeaderTemplate> <table> </HeaderTemplate> <ItemTemplate> <tr> <td><%# Eval("Prompt") %>:</td> <td><asp:PlaceHolder ID="plControl" runat="server" /> <input type="...

Help! Custom Server Control using User Control
I've been bashing my head for a few days on this problem. My Custom Server Control loads the User Control and renders it properly.  But, when I run the web application the controls (ex: buttons) from the User Control is not firing the event (ex: a button click to change the label's text)?Here is a snippet of part of my code:    Protected Overrides Sub CreateChildControls()        plhPanel = New System.Web.UI.WebControls.PlaceHolder        ContentFileLoaded = New System.Web.UI.U...

Using ajax control (CollapsiblePanelExtender) in custom server control
 Hi I'm trying to write a server control that contains the collapsiblePanelExtender from the ajax toolkit.  But I have the following error when i try to show this control: Extender control 'ctl00$contentHolder$ctl00$Ant_baseModule1_cpeDemo' is not a registered extender control. Extender controls must be registered using RegisterExtenderControl() before calling RegisterScriptDescriptors(). I have no idea what i must add or change to make it working.  Anyone who has an idea?  Or maybe I'm doing it all wrong? This is my code:   Protected Overrides Sub Render(...

How to Render controls within an UpdatePanel in a Custom Server Control
Hi,Im writting a CompositeControl that contains a few UpdatePanels (TabContainer with an UpdatePanel on each TabPanel to make Tab control panels load "on-demand"). I want to control the renderring of the controls within the UpdatePanel's ContentTemplateContainer.How should I implement the render method of my CompositeControl?Should I use a custom UpdatePanel (inherit from UpdatePanel and override the RenderContents method)? is there a simpler solution? (because I need a different "render" for each tab panel....)Thanks Tal88 Hi, I want to control the renderring o...

Can we use existing Server Controls to create Custom Controls?
Can we use the existing ASP.Net Server Controls to create Custom Controls? I am able to use HtmlTextWriter to make my Custom Controls. I want to be able to add regular ASP.Net server controls to create my Custom Controls. Is this possible? Can anyone provide a sample? Basically, you just need to inherit the control you want to use, like this: Public Class MyControl Inherits System.Web.UI.WebControls.TextBox Then you can override the methods you want and add code as needed. Peter BrunoneMS MVP, ASP.NETFounder, EasyListBox.comDo the impossible, and go home early. The str...

Custom Server Control With Child Control
All, I am currently putting together a very simple control. The new control outputs a table with two rows. The top row contains a heading and the bottom row will contain any other content. The control as it stands works perfectly well and I can place text into the content row no problem. Now, to the problem. Once I'd completed the control I figured it would be neat to enable the developer to add controls directly into the bottom row (content row) of the outputted table. As you probably know the WebControl class has a Controls collection which the developer can use to add any other...

Custom Server Control with Child Controls
I have a custom server control <xx.Parent... /> which parses custom child controls <xx.Child... />. In Visual Studio 2008, IntelliSense shows me both when I start typing my control namespace. How can I prevent the child control from showing up in IntelliSense  unless I'm adding it within the parent tags?Thanks. --Rudy...

Web resources about - Using a server control in the rendering a custom control -

Color rendering index - Wikipedia, the free encyclopedia
The color rendering index ( CRI ), sometimes called color rendition index , is a quantitative measure of the ability of a light source to reveal ...

Rendering Facebook Connect in Other Languages
Rendering Facebook Connect in Other Languages

3D rendering - Flickr - Photo Sharing!
Project name: health valley project Address: Conghua District,China Frontop creates 3d rendering, architectural rendering, architectural visualization ...

Unlimited Detail Real-Time Rendering Technology Preview 2011 [HD] - YouTube
[HD version of the other video] Hi everyone. We've been working very hard and we hope you like what we've made. This is just our 1 year report, ...

Pop singer whose smooth rendering of country music made her a star
Patti Page offered a soothing counterpart to the revolutionary new sound of rock'n'roll.

Boston 2024 Olympic Designs & Renderings Released [PHOTOs] - BostInno
Boston's possible bid for the 2024 Summer Olympics cleared a major hurdle on Thursday night, when the United States Olympic Committee selected ...

LG G4 micro site surfaces with full device renderings, listed features, and more
... left a trail to a new G4 micro site (removed by LG) embedded within the source code of an official teaser page. The site showcases full renderings, ...

New renderings of the Spaceship campus: Solar paneled roof, beautiful natural surroundings
Dark roof adorning Apple’s upcoming Spaceship campus suggest solar panels. UPDATE [Wednesday, December 7, 2011 at 12:55pm]: A reader chimed in ...

New renderings released of proposed NFL stadium in Inglewood
New renderings have been released of St. Louis Rams&#39; owner Stan Kroenke&#39;s proposed &#36;1.86-billion venue at the former Hollywood Park ...

Congress is great … at ducking issues, rendering itself irrelevant
According to the Associated Press, Senate Majority Leader Mitch McConnell "grudgingly" conceded this week that he and his fellow Republicans ...

Resources last updated: 11/23/2015 12:49:53 PM