473,769 Members | 3,368 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Render vs RenderContents

Hi.

What's the difference between the Render method (overridden when creating
custom controls) and the RenderContents method.... (overridden when creating
custom controls) ?

From MSDN:

Render - Sends server control content to a provided HtmlTextWriter object,
which writes the content to be rendered on the client.
Overridable Protected Sub Render( ByVal writer As HtmlTextWriter )

RenderContents - Renders the contents of the control into the specified
writer. This method is used primarily by control developers.
Overridable Protected Sub RenderContents( ByVal writer As HtmlTextWriter )

So.... to me, it's not any clearer than before reading these "helpful"
lines. To me, they are just the same.

Thank you,
Alex.
Nov 19 '05 #1
1 5952
The WebControl breaks down the "Render" method of Control method into
three parts:

1. StartingTag: RenderBeginTag
2. Content within tag: RenderControl
3. End of Tag: RenderEndTag

If you want to provide full functionality on your own, override the
Render Method.

However, if you wish to use RenderBeginTag and RenderEndTag
functionality as provided in WebControl and wish to provide only the
inner content, override RenderControl.

--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
--------------------------------

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9629
by: George Ter-Saakov | last post by:
I am trying to wrap PlaceHolder so it will output prefix/suffix (like <div>, </div>) before render the actual control. So i created public class clsSection : PlaceHolder protected override void Render(HtmlTextWriter writer) {
1
2174
by: Tomas | last post by:
Is there any sequence diagram on the web that clearly shows in which order all Page methods (load, render and so on) are being called compared to the order the page's contained control methods are being called by the asp.net enginge ??? To be more specific, the thing I currently am most interested in understanding is from which method in the Page class you can know that that the Render method of all aggregated controls have been called...
2
1322
by: Andrea Williams | last post by:
I have a form where the user chooses reporting options and when submit is clicked, I need to present them with dynamically created excel file. In Classic ASP I would just change the viewing options, but in ASP.NET I'm using code-behind. Is there a way to clear what is scheduled to be renedered and write new information into the page render? OR Should I Server.Transfer to a different page that renders the correct info?
4
4220
by: Zuel | last post by:
Hi Folks. So I have a small problem. My DoPostBack function is not writen to the HTML page nor are the asp:buttons calling the DoPostBack. My Goal is to create a totaly dynamic web page where the server generates the HTML based on a passed in parameter. In our case, CustomerID. Every Customer ges a branded website with there logos and webpage etc.. To Avoid having 1 ASP.Net application running for each client I am attempting a more...
1
3227
by: sonic | last post by:
I generate a button link control in following Manner. Button b = new Button(); b.Click = MyEventHandler(...); If i add this button to current control with: this.Controls.Add( b ); it will render, and its clicked event will be triggered properly. Unfortunately I do not have alot of control over where the button shows up.
5
1784
by: sk | last post by:
Hi, I'm trying to override the Render method of my Page class. Are there any standard guidelines for this? Thanks. Shardul
1
4110
by: Kevin R | last post by:
This is one of the weirdest problems I have ever run into. I have had to trim down a bunch of code to give a sample that is more easily readable by those who will view this. Here is the problem: I dynamically add an htmlcheckbox to a webform in the pages render and set the checked value to true. When the page loads, if I remove the check from the checkbox and then submit it, in the submit event the checkbox' checked value is still...
1
1885
by: Peter Kirk | last post by:
Hi, if I am writing a web custom control, do I override the Render method or the RenderControl method - and what is the difference? Thanks, Peter
3
2896
by: Allan Ebdrup | last post by:
We're pretty new to ASP.Net 2.0 and we're having a discussion about best practice when developing custom server web controls. I can see that in for example the Wizard control the table contained within is a control and all the children are controls. That seems to be a good practice to me, use controls when possible. On the other hand one of the developers here wants to override the Render methods and create child tables with strings and a...
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9420
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10201
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9982
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9851
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8862
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5293
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5439
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.