I ran into this error:
The remote name could not be resolved: 'russgates85-001-site1.smarterasp.net'
When I request html content to be read using the web client, it gives me an error. Below is my code.
string strHTML = string.Empty; WebClient myClient = new WebClient(); UTF8Encoding utf8 = new UTF8Encoding(); byte[] requestHTML; string pdfFileName = "outputpdf_" + DateTime.Now.Ticks + ".pdf"; string webUrl = Request.Url.Scheme + "://" + Request.Url.Host + (Request.Url.Port != 80 ? ":" + Request.Url.Port : ""); requestHTML = myClient.DownloadData("http://russgates85-001-site1.smarterasp.net/adminsec/images/printinvoice.aspx?iid=2");
When I put the same url in my local code / environment, it works fine.
source share