473,473 Members | 1,723 Online
Bytes | Software Development & Data Engineering Community
Create 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 5924
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
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...
1
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...
2
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...
4
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...
1
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...
5
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
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:...
1
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
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...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
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 ...
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.