the rendered output is just a i/o stream of the html content. you can do
anything you want to it, but you would have to reparse it.
the preRender event is the last change to modifiy in the memory model of the
"parsed" page. only items with a runat=server are parsed into the tree,
everty thiong between server objects is parsed as a literal
image the following html:
<html>
<head>
<link id=link1 runat=server href="foo.css" \>
</head>
<body>
<span id=span1 runat=server><font size=1>hi</font></span>
</body>
</html>
is parsed into 5 controls
l1 = new LiteralControl("<html>\n<head>\n");
link1 = new HtmlGenericControl("link");
link1.ID = "link1"
link1.Attributes.Add("href","foo.css");
l2 = new LiteralControl("</head>\n<body>");
span1 = new HtmlGenericControl("span");
span1.ID = "span1";
span1.InnerHtml = "<font size=1>hi</font>";
l3 = new LiteralControl("</body>\n</head>");
these five controls will be added to the pages Controls collection.
-- bruce (sqlwork.com)
<ke*****@u.washington.edu> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
ASP.NET is a kind of "engine" that takes declarative markup and code and
renders these instructions into presentational forms. And every page is a
class.
With that in mind I'm wondering,
a) how to intercept the rendered output and do further programmatic things
with it;
and
b) how coarse or finely grained the control might be. One could envision
the ASP.NET designers giving you programmatic access to subselections of
the page HTML (e.g. <head> ... </head> <body> ... </body> ). Maybe even
a page hieararchy.
I'm interested in rendering content into various non-HTML forms (pdf,
Flash text, multipart mails) and I'd like the ASP.NET engine to do the
hard work of preprocessing some of this content; these ideas are
especially interesting with the availability of skins, themes, and master
pages in asp.net 2.0.
Barring programmatic access, I suppose I can yank what I want using
regular expressions, but I'm curious if there's a better way.
Thanks,
-KF