HtmlTextWriter with Callback

M

Mike

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
 
B

Brock Allen

There already is:

Control.SetRenderMethodDelegate

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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top