tags:

views:

84

answers:

2

I have one site that is displaying html content that needs to be displayed on another site (first site is front end to content management system).

So site1 page = http://site1/pagecontent

and on site 2 (http://site2/pagecontent) I need to be able to display the contents shown on site 1 page.

I am using .Net C# (MVC), and do not want to just use an iframe.

Is there a way to suck in the html into a string variable?

+1  A: 

Sure. See the System.Net.WebClient class, specificially, the DownloadString() method.

Joel Coehoorn
+1  A: 

Yes, you can use the WebClient class: http://msdn.microsoft.com/en-us/library/system.net.webclient.aspx

WebClient wClient = new WebClient();
string s = wClient.DownloadString(site2);
Gonzalo Quero