Render Web Page in C# + ASP.NET MVC
//HTML VIEW
<h2>Web Page</h2>
<div>
@{
Html.RenderAction("GetWebPage");
}
</div>
//MVC CONTROLLER
public ActionResult GetWebPage()
{
string result = string.Empty;
try
{
using( WebClient client = new WebClient() )
{
result = client.DownloadString("http://coderwall.com");
}
}
catch( Exception e)
{
result = e.Message;
}
return Content(result);
}
Written by Ion D. Filho
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Mvc
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#