I have code that uses an HttpWebRequest to request a .ASP page (asp 3.0), with some parameters in the URL. That ASP page will generate a PDF by getting some data from a database. Due to error in the ASP code, I’m getting a WebException with IIS’s 500 server error when I try to get the response from the request. And that’s fine, but the exception’s message doesn’t really say anything other than 500 error occurred.
If I copy paste the URL that I’m requesting in IE, I do get some details since I have friendly errors disable and IIS configured to send the real error text to the user.
“Technical Information (for support personnel)
Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
“
I’ve done a QuickWatch on the Exception and visited all of the properties, but not one contained this data.
Is there a way to get this information on the WebException?
Thanks.
Yes, you can read the response body: