Run URL from ASP.NET/C#

Sometimes it can be handy to run a URL from a ASP.NET page (eg. aspx, ascx or MVC control). It could be simply executing one or more webservices, without wanting a result back.

It’s actually pretty simple!

[csharp]
string url = "http://egeek.dk/service.ashx";
using (System.Net.WebClient client = new System.Net.WebClient())
{
client.DownloadString(url);
}
[/csharp]