473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

HtmlTextWriter with Callback

I write many custom controls and think that the HtmlTextWriter would benefit
from a method such as:

writer.Write("<td>{0}<td>", new HtmlTextWriterCallback(this.WriteCell))

void WriteCell(HtmlTextWriter writer)
{
writer.Write("Some Content");
}

This is a simple example but for html templating of a site this would be
very efficient, useful and cool.

Thanks,

Mike
Nov 19 '05 #1
1 1091
There already is:

Control.SetRenderMethodDelegate

This is how ASP.NET renders controls that have nested code blocks:

<asp:Label><% Response.Write("fooey"); %></asp:Label>

-Brock
DevelopMentor
http://staff.develop.com/ballen
I write many custom controls and think that the HtmlTextWriter would
benefit from a method such as:

writer.Write("<td>{0}<td>", new
HtmlTextWriterCallback(this.WriteCell))

void WriteCell(HtmlTextWriter writer)
{
writer.Write("Some Content");
}
This is a simple example but for html templating of a site this would
be very efficient, useful and cool.

Thanks,

Mike


Nov 19 '05 #2

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

Similar topics

4
by: Blaz Ziherl | last post by:
Hi, I am developing an application in VisualBasic .NET and got the following error: "An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dll ...
1
by: Rudy Ko | last post by:
Hi, All: I'm populating database records into a panel controls and want to render that panel into a HtmlTextWriter which will creating a word document. Do you know how to insert a page break...
3
by: Lee Chapman | last post by:
Hi, I want my ASP.NET web application to use a custom HtmlTextWriter. i.e. I want the object that the Framework passes to System.Web.UI.Control.Render() to be my own object, MyHtmlTextWriter,...
2
by: larryvan | last post by:
I have been beating my head against a wall for two days now. I need to output a hyperlink using htmltextwriter.write that looks like this: <a...
2
by: Rothariger | last post by:
Hello, im testing to make a webapplication, that has 2 buttons and with this buttons you could change the databinding of a webgrid... i have a problem, that the first time it renders 100% ok, but...
2
by: Alani | last post by:
Hello All, I'm a new ASP.NET programmer and I want to create a custom control consist of two properties (Number1) and (Number2) and both of them are integers and default value = 0, now I'm...
1
by: Timbo | last post by:
Hi all, This is my first message here so i'll try and include all the information that will help you help me out, if possible. Basically I am using C# in ASP.NET 2.0 and have a Repeater...
4
by: James Page | last post by:
I can't seem to get HtmlTextWriter / renderControl to work for sending a control (html) in an e-mail messsage (VB.NET). Keeps telling me that control needs to be in a form tag with runat server...
3
by: =?Utf-8?B?cndvb2RydWY=?= | last post by:
Hello All, I am using an HtmlTextWriter to writer out some html. Prior to sending the content to the text writer, HttpUtility.HtmlEncode the string. However, doing so results in a string where...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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...
0
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,...

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.