Reputation: 3025
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?
Upvotes: 0
Views: 187
Reputation: 3323
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);
Upvotes: 1
Reputation: 415600
Sure. See the System.Net.WebClient
class, specificially, the DownloadString()
method.
Upvotes: 1