Vulnerability in EPiServer.Forms
It depends a little on what html your trying to get.If its just the htmlcode entered for some property (for example "MainBody") on the other page, then it would be as simple as:PageData otherPage = EPiServer.DataFactory.Instance.GetPage(otherPageRef);string html = otherPage["MainBody"] as string;
PageData otherPage = EPiServer.DataFactory.Instance.GetPage(otherPageRef);string html = otherPage["MainBody"] as string;
But, if you want to get the "complete" htmlpage (as it would have been rendered by the aspx/ascx) it would be a little trickier. The easiest solution would be to simply issue a webrequest to the page and read the returned html response stream through a StringReader.While this works, it has the downside of hitting the server with a new request which could be both time and resource consuming, especially on a site with lots of requests.
I have done some hacks around the PageParser.GetCompiledPageInstance() which lets you "shortcut" the asp.net request by calling into the IHttpHandler directly without the need to issue a "full" webrequest and also to capture the rendered html output.
I could probably dig out some sample code for you if youre interested, just drop me a email (johan.olofsson @ episerver.com).
If anyone's interested, I made a blog post (with sources) on how one can get a page's html without a "full" web request.