Hi All,<BR><BR>I am using a WebRequest & WebResponse to GET the contents of an aspx page as a string (code below).<BR><BR>It&#039;s working fine, except that when the aspx page has an error on it, I want to know precisely what the error was (ie I want to get the error message that would be displayed if you were viewing the aspx page in a brower).<BR><BR>Instead I always get this error:<BR> The remote server returned an error: (500) Internal Server Error<BR>pointing to the line:<BR> WebResponse myResponse = myRequest.GetResponse();<BR><BR>Can anyone tell me how I can GET the original error text returned to me?<BR><BR>Thanks,<BR><BR>JON<BR><BR><BR>=====<BR> CODE<BR>=====<BR><BR><BR>// Initialize the WebRequest.<BR>WebRequest myRequest = WebRequest.Create("http://localhost/PageWithError.aspx");<BR><BR>// Return the response.<BR>WebResponse myResponse = myRequest.GetResponse();<BR><BR>// Convert the GET to a string and display it<BR>StreamReader sr = new StreamReader(myResponse.GetResponseStream(),System .Text.Encoding.Default);<BR>string sBuffer;<BR>sBuffer = sr.ReadToEnd();<BR>sr.Close();<BR>txtDisplayHtml.T ext = sBuffer;<BR><BR><BR><BR><BR><BR><BR><BR><BR>PS First posted yesterday to:<BR><BR>microsoft.public.dotnet.framework.aspne t,<BR>microsoft.public.dotnet.framework,<BR>micros oft.public.dotnet.languages.csharp<BR><BR>No answers yet...<BR>