Re: rendered HTML

Jacob Mattison <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.web
Message-ID <[email protected]>
It seems the original poster wants to know how to do this
_programmatically_ within ASP.NET.  It looks like you could use the
Windows Forms WebBrowser Control -- in theory you could get an instance
of this without displaying it, feed it the URL, and then grab the
rendered DocumentText.  No idea if you could really do this server-side
in ASP.NET, but worth a try.

See http://msdn2.microsoft.com/en-us/library/w290k23d.aspx

Jacob Mattison
Web Developer
Johnson & Wales University
[email protected]
(401) 598-1572

> -----Original Message-----
> From: Discussion of building .NET applications targeted for 
> the Web [mailto:[email protected]] On Behalf Of 
> Fernando Tubio
> Sent: Thursday, December 07, 2006 3:34 PM
> To: [email protected]
> Subject: Re: [DOTNET-WEB] rendered HTML
> 
> 
> I'm sure there must be better ways to do this, but in Firefox 
> you can select the portion of the page, or Ctrl + A for the 
> complete page, then in the context menu click on 'View 
> Selection Source...'
> 
> Another alternative could be Nikhil Kothari's Web Development 
> Helper [1]. If you select the DOM Inspector, followed by the 
> Markup tab, it will show you the current content of the page, 
> both as a treeview and HTML.
> 
> 
> Fernando Tubio
> 
> 
> [1] http://projects.nikhilk.net/Projects/WebDevHelper.aspx
> 
> 
> 
> ----- Original Message -----
> From: "dave wanta" <[email protected]>
> To: <[email protected]>
> Sent: Thursday, December 07, 2006 4:56 PM
> Subject: Re: [DOTNET-WEB] rendered HTML
> 
> 
> Hi Mark,
> Thanks for the reply, but actually that doesn't do what I was 
> talking about.
> 
> All this does is get the contents of the from the webserver. 
> However, what I want is the rendered contents (which may or 
> may not live on a webserver). It could just be a string of 
> HTML stored in a database.
> 
> For example, if there was some javascript interspersed in 
> some HTML in there that was:
> 
> Hello <script>document.write( getName() );</script>,<BR> 
> <script> var line = 'this is a line of text'; document.write( 
> '<b>' + line + '</b>'); </script>
> 
> 
> What I want to actually get is:
> Hello jdoe,<BR>
> "<b>this is a line of text</b>"
> 
> Hence my question about getting the *rendered* html.
> 
> Cheers!
> Dave
> 
> ----- Original Message -----
> From: "Mark Kucera" <[email protected]>
> To: <[email protected]>
> Sent: Thursday, December 07, 2006 1:50 PM
> Subject: Re: [DOTNET-WEB] rendered HTML
> 
> 
> Here's a little function that I've used for a while that does 
> just that.
> 
> public static string GetHtmlPage(string location)
> {
>  string retVal;
>  WebResponse objResponse;
>  WebRequest objRequest = System.Net.HttpWebRequest.Create(location);
>  objResponse = objRequest.GetResponse();
>  using (StreamReader sr = new
> StreamReader(objResponse.GetResponseStream()))
>  {
>         retVal = sr.ReadToEnd();
>  }
>  return retVal;
> }
> 
> Good Luck
> MK
> 
> 
> -----Original Message-----
> From: Discussion of building .NET applications targeted for 
> the Web [mailto:[email protected]] On Behalf Of 
> dave wanta
> Sent: Thursday, December 07, 2006 2:42 PM
> To: [email protected]
> Subject: [DOTNET-WEB] rendered HTML
> 
> Hi All,
> Since many web pages contain javascript to layout the page, 
> does anyone know how to get at the rendered HTML of a webpage 
> filled with javascript? I'm guessing you would some how need 
> to create an instance of IE or Firefox, and tap into 
> something (I just don't know what that 'something' is). I 
> know there used to be an IE tool (back in the v4.x days) 
> where you could right-click in the browser window and select 
> "view rendered html".  I was wondering if there was someway 
> to do this in .NET.
> 
> Thanks,
> Dave
> 
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
> 
> View archives and manage your subscription(s) at 
> http://discuss.develop.com
> 
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
> 
> View archives and manage your subscription(s) at 
> http://discuss.develop.com
> 
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
> 
> View archives and manage your subscription(s) at 
> http://discuss.develop.com
> 
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
> 
> View archives and manage your subscription(s) at 
> http://discuss.develop.com
> 

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.