HTTP Post error

J

John Straumann

Hello all:

I am trying to call an ASPX page from another ASPX page code-behind file by
using the HTTP Request object. By loading the page and typing:

javascript:alert(resultRender.outerHTML)

in the navigation bar I was able to get the code that calls the page, and I
then pasted that into a static HTML page. This works fine, when I load the
static HTML page in IE it runs the ASPX page and returns the results.
However if I try to call the ASPX page using HTTP and POST, I get an error:

General exception: System.Net.WebException: The remote server returned an
error: (401) Unauthorized.
at System.Net.HttpWebRequest.GetResponse()
at PostSubmitter.PostData(String url, String postData)
at PostSubmitter.Post()
at _Default.Page_Load(Object sender, EventArgs e)

So I tried setting a credential cache with explicit credentials, but that
did not work either.

Can anyone make a suggestion as to how I can track down the error? Since I
can call the page from the static HTML page, I *should* be able to access
the page from an HTTP call, should I not?

Thanks in advance for any and all help.

John.
 
S

Stan

Hello all:

I am trying to call an ASPX page from another ASPX page code-behind file by
using the HTTP Request object. By loading the page and typing:

javascript:alert(resultRender.outerHTML)

in the navigation bar I was able to get the code that calls the page, andI
then pasted that into a static HTML page. This works fine, when I load the
static HTML page in IE it runs the ASPX page and returns the results.
However if I try to call the ASPX page using HTTP and POST, I get an error:

General exception: System.Net.WebException: The remote server returned an
error: (401) Unauthorized.
   at System.Net.HttpWebRequest.GetResponse()
   at PostSubmitter.PostData(String url, String postData)
   at PostSubmitter.Post()
   at _Default.Page_Load(Object sender, EventArgs e)

So I tried setting a credential cache with explicit credentials, but that
did not work either.

Can anyone make a suggestion as to how I can track down the error? Since I
can call the page from the static HTML page, I *should* be able to access
the page from an HTTP call, should I not?

Thanks in advance for any and all help.

John.

Hi John

I don't know the answer to your specific question but since you are
apparently just trying to call one ASPX page from another I am bound
to ask if you are aware of:

Server.Transfer()
Server.Execute()
Response.Redirect()

?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top