Is there a way to render a page with a specific culture using System.Net.WebClient?
For example:
System.Net.WebClient client = new System.Net.WebClient();
CultureInfo myCulture = System.Globalization.CultureInfo.GetCultureInfo("es-ES");
// Do something to specify the culture info
client.DownloadString(someUrl);
All that the WebClient class does is to perform an HTTP request and read/parse the response. When sending this request you could set headers such as
Accept-Languageusing the Headers property:If you are talking about the encoding, when you use the DownloadString method it will look for the response headers in order to use the proper encoding and if the server sends wrong response header you might have encoding problems. If this is the case you could use the DownloadData method which will return you the response as a byte array and you could apply the proper encoding when converting this array to string.