| Here is how to get the RAW HTML of a Web Page on your SharePoint Site using the Client Object Model:
Just substitute your Site Collection name instead of "sitecollection"
and your page path along with the Relative Server URL instead of
/Sites/Vard/SitePages/Home.aspx
ClientContext clientcontext = new ClientContext(sitecollection);
var page = Microsoft.SharePoint.Client.File.OpenBinaryDirect(clientcontext, "/Sites/Vard/SitePages/Home.aspx");
StreamReader reader = new StreamReader(page.Stream);
string pageHTML = reader.ReadToEnd();
The string variable pageHTML will now have the raw html of the Home.aspx page.
Have Fun!
|