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

Discussion in 'ASP .Net' started by Jeff, May 20, 2005.

  1. Jeff

    Jeff Guest

    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!!!
     
    Jeff, May 20, 2005
    #1
    1. Advertising

  2. Jeff

    Guest

    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
     
    , May 20, 2005
    #2
    1. Advertising

  3. Jeff

    Jeff Guest

    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,

    <> wrote in message
    news:...
    > 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
    >
     
    Jeff, May 20, 2005
    #3
  4. Jeff

    Guest

    , May 20, 2005
    #4
  5. Jeff

    Jeff Guest

    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.........


    <> wrote in message
    news:...
    > 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
    >
     
    Jeff, May 20, 2005
    #5
  6. Jeff

    Joerg Jooss Guest

    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:
     
    Joerg Jooss, May 25, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sriram Mallajyosula

    How do I post data from aspx page to another aspx page.

    Sriram Mallajyosula, Nov 5, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,063
    Steve C. Orr [MVP, MCSD]
    Nov 5, 2003
  2. Peri
    Replies:
    1
    Views:
    3,099
    =?Utf-8?B?Um90aGFyaWdlcg==?=
    Jul 21, 2005
  3. Rod
    Replies:
    2
    Views:
    1,857
  4. Edvin

    HttpMethod is always GET

    Edvin, Jul 22, 2003, in forum: ASP .Net Mobile
    Replies:
    0
    Views:
    189
    Edvin
    Jul 22, 2003
  5. Andreas Schulze

    modify HttpMethod or HttpRequest propertys

    Andreas Schulze, Oct 28, 2004, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    216
    Dan Rogers
    Nov 18, 2004
Loading...

Share This Page