views:

21

answers:

0

I have the following code:

        HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create("http://mycomputer/myWebApp/WebPage2.aspx");

        myHttpWebRequest.Credentials = CredentialCache.DefaultNetworkCredentials;
        HttpWebResponse myHttpWebResponse = HttpWebResponse)myHttpWebRequest.GetResponse();

The last line of code throws a (500) Internal Server Error... This code is part of myWebApp/WepPage1.aspx, yes both aspx pages are on the same webapp.

What I want to accomplish is to get WebPage2.aspx html response, put it on an email and send it from WebPage1.aspx.

I would really appreciate any tips.. Thanks!!!