473,387 Members | 1,463 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

HTTP Post error

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.

Aug 16 '08 #1
1 1243
On 16 Aug, 01:47, "John Straumann" <jstraum...@hotmail.comwrote:
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()

?
Aug 17 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Spud | last post by:
<?php // pullpage function by Nick bouton http://www.nickbouton.com/. $CustomerID = "IDHERE"; $method = "POST"; $host = "xml.mydata.com"; $usepath = "/xml.asp"; //print all vars in an...
7
by: Paul | last post by:
I thought this is more of an IE issue but i've had no joy on that group perhaps somebody here will have a clue. If i click a link to a web page embedded in Excel (97 OR 2000) i get the standard...
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
6
by: Nick Horrocks | last post by:
I have set up a custom error page for 404 errors. However the HTTP status code returned is 302 followed by 200, this causes search engines not to remove old pages from their index. How can I...
1
by: Cory Koski | last post by:
Hi all, I'm currently trying to build a component I can use in traditional ASP that utilizes the .NET webservice. I'm using VB.NET to create my class, and I am registering the class for COM...
0
by: WIWA | last post by:
Hi, I want to login to a password protected website and fetch the content of the page behind. I have based my code on http://weblogs.asp.net/jdennany/archive/2005/04/23/403971.aspx. When I use...
3
by: JansenH | last post by:
We have implemented a 'HTTP Post' client in C# that posts Xml documents to a webserver. This is working fine if the post rate is one post for every 20 seconds. But if the post rate is increased to...
1
by: Arfeen | last post by:
Hi All, I need help again ..... I have an asp.net web page which I hit using the "HTTP POST" method. My ASP.NET page is a basic hello world example with the following code: private void...
2
by: =?Utf-8?B?cGhlbmdsYWk=?= | last post by:
I am not sure really how to explain this but here goes. I am creating some new web services and I want to be able to post data like the following: <Data> <some value>1</some value> <more...
4
by: CindyH | last post by:
Hi: I have the following code: Dim url As String = "http://xx01xx01:800/some.ashx" Dim myrequest As System.Net.WebRequest = Nothing Dim myresponse As System.Net.WebResponse = Nothing...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.