By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,773 Members | 1,779 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,773 IT Pros & Developers. It's quick & easy.

My Asp.net aspx page always reports HttpMethod is "GET" even it is "POST" from client, ?

P: n/a
Visual Studio 2003
DotNet framework 1.1
Windows 2000 Pro

I create two pages in an Asp.net application, one is html page with a form
in it:
....
<form id="testForm" method="post" action="test.aspx" runat="server">
<input type="hidden" id="hiddenTest" value="hello, world">
<input type="submit" id="btnSubmit" value="submit">
</form>
....

Another one page is aspx page. It is a blank aspx page in which Request info
is shown in Page_load even handler:
private void Page_Load(object sender, System.EventArgs e) {

//show Request info

string httpMethod = Request.HttpMethod;

....

If I run this web application from the html page and click the submit
button, the aspx page gets called. But from debugger, the value of
Request.HttpMethod will always be "GET" rather than "Post". ???

Has anyone had this kind of problems before?

Thanks!!!




Nov 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
You shouldn't post from one apsx page to another,

I know this seems alien if you have come from ASP development but aspx
pages should post back to them selves, let me know if you need any more
info

Nov 19 '05 #2

P: n/a
Yes, would you please suggest me some links to the related documentation
about this designed behavior that I can't use Http POST to send request to
an Aspx page?

Thanks,

<ga**********@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
You shouldn't post from one apsx page to another,

I know this seems alien if you have come from ASP development but aspx
pages should post back to them selves, let me know if you need any more
info

Nov 19 '05 #3

P: n/a
this is a good place to start

http://samples.gotdotnet.com/quickstart/aspplus/

don't get overwhelmed by it all, stick with it asp.net is strange at
first, but once you have used it for a little while you'll never go back

Nov 19 '05 #4

P: n/a
The exact same code works on another machine fine, isn't it weird?

HttpMethod is "POST" on that machine when the aspx page gets the request
from the Html page. ??? What is wrong with my machine!! grrrrrrrr.........
<ga**********@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
You shouldn't post from one apsx page to another,

I know this seems alien if you have come from ASP development but aspx
pages should post back to them selves, let me know if you need any more
info

Nov 19 '05 #5

P: n/a
Jeff wrote:
Yes, would you please suggest me some links to the related
documentation about this designed behavior that I can't use Http POST
to send request to an Aspx page?


Of course you can and you should (most of the time). What Gareth meant
to say is that in the ASP.NET model a page only sends requests to
itself, not to another page. Navigation is either performed by
Hyperlinks, Server.Transfer() or Response.Redirect().
Cheers,
--
http://www.joergjooss.de
mailto:ne********@joergjooss.de
Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.