HTTP verb POST used not allowed

Discussion in 'ASP .Net' started by Ben, Jul 3, 2007.

  1. Ben

    Ben Guest

    Hi,

    i try to submit a form in an aspx file through javascript to an classic asp
    page like this:

    <form id="ins" method="post">
    <input id="conn" name="conn" type="hidden" />
    <input runat="server" id="submit1" type="button" onclick="inexcel()"/>
    </form>
    <script language="javascript" type="text/javascript">
    function infilel()
    {
    document.getElementById("conn").value=conn
    document.getElementById("ins").action="infile.asp"
    document.getElementById("ins").submit()
    return true;
    }

    </script>


    i get the message: The HTTP verb POST used to access path
    '/enquete/infile.asp' is not allowed.

    I know classic asp pages are allowed to run because in this asp.net
    application, using e.g. window.location.href="myfile.asp" works.

    What do i have to change in the configuration of IIS 5.0 (or 6.0) to make
    this run, or is it an asp.net issue?

    Thanks for help
    Ben
    Ben, Jul 3, 2007
    #1
    1. Advertising

  2. I'm not sure if this will work, but try :

    <asp:Button
    ID="Button1"
    PostBackUrl="/enquete/infile.asp"
    runat="server"
    Text="Submit" />

    In ASP.NET,. you need to set the PostBackUrl in order to do cross page posting.

    I know that works when the page being posted to is an aspx page,
    but try it and see if it works for asp pages, too.

    What I *do* know is that if you *don't* set the PostBackUrl, you can't cross-post.




    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    "Ben" <b@bn> wrote in message news:O$...
    > Hi,
    >
    > i try to submit a form in an aspx file through javascript to an classic asp page like this:
    >
    > <form id="ins" method="post">
    > <input id="conn" name="conn" type="hidden" />
    > <input runat="server" id="submit1" type="button" onclick="inexcel()"/>
    > </form>
    > <script language="javascript" type="text/javascript">
    > function infilel()
    > {
    > document.getElementById("conn").value=conn
    > document.getElementById("ins").action="infile.asp"
    > document.getElementById("ins").submit()
    > return true;
    > }
    >
    > </script>
    >
    >
    > i get the message: The HTTP verb POST used to access path '/enquete/infile.asp' is not allowed.
    >
    > I know classic asp pages are allowed to run because in this asp.net application, using e.g.
    > window.location.href="myfile.asp" works.
    >
    > What do i have to change in the configuration of IIS 5.0 (or 6.0) to make this run, or is it an asp.net issue?
    >
    > Thanks for help
    > Ben
    >
    >
    >
    >
    >
    >
    >
    Juan T. Llibre, Jul 3, 2007
    #2
    1. Advertising

  3. Ben

    Ben Guest

    Thanks, i'll try

    "Juan T. Llibre" <> schreef in bericht
    news:...
    > I'm not sure if this will work, but try :
    >
    > <asp:Button
    > ID="Button1"
    > PostBackUrl="/enquete/infile.asp"
    > runat="server"
    > Text="Submit" />
    >
    > In ASP.NET,. you need to set the PostBackUrl in order to do cross page
    > posting.
    >
    > I know that works when the page being posted to is an aspx page,
    > but try it and see if it works for asp pages, too.
    >
    > What I *do* know is that if you *don't* set the PostBackUrl, you can't
    > cross-post.
    >
    >
    >
    >
    > Juan T. Llibre, asp.net MVP
    > asp.net faq : http://asp.net.do/faq/
    > foros de asp.net, en español : http://asp.net.do/foros/
    > ======================================
    > "Ben" <b@bn> wrote in message news:O$...
    >> Hi,
    >>
    >> i try to submit a form in an aspx file through javascript to an classic
    >> asp page like this:
    >>
    >> <form id="ins" method="post">
    >> <input id="conn" name="conn" type="hidden" />
    >> <input runat="server" id="submit1" type="button"
    >> onclick="inexcel()"/>
    >> </form>
    >> <script language="javascript" type="text/javascript">
    >> function infilel()
    >> {
    >> document.getElementById("conn").value=conn
    >> document.getElementById("ins").action="infile.asp"
    >> document.getElementById("ins").submit()
    >> return true;
    >> }
    >>
    >> </script>
    >>
    >>
    >> i get the message: The HTTP verb POST used to access path
    >> '/enquete/infile.asp' is not allowed.
    >>
    >> I know classic asp pages are allowed to run because in this asp.net
    >> application, using e.g.
    >> window.location.href="myfile.asp" works.
    >>
    >> What do i have to change in the configuration of IIS 5.0 (or 6.0) to make
    >> this run, or is it an asp.net issue?
    >>
    >> Thanks for help
    >> Ben
    >>
    >>
    >>
    >>
    >>
    >>
    >>

    >
    >
    >
    Ben, Jul 3, 2007
    #3
  4. Ben

    bruce barker Guest

    location.href is a GET. the error means iis is not configred to allow
    post to an asp application in the vdir. look at the mapping and add the
    POST verb.

    -- bruce (sqlwork.com)

    Ben wrote:
    > Hi,
    >
    > i try to submit a form in an aspx file through javascript to an classic asp
    > page like this:
    >
    > <form id="ins" method="post">
    > <input id="conn" name="conn" type="hidden" />
    > <input runat="server" id="submit1" type="button" onclick="inexcel()"/>
    > </form>
    > <script language="javascript" type="text/javascript">
    > function infilel()
    > {
    > document.getElementById("conn").value=conn
    > document.getElementById("ins").action="infile.asp"
    > document.getElementById("ins").submit()
    > return true;
    > }
    >
    > </script>
    >
    >
    > i get the message: The HTTP verb POST used to access path
    > '/enquete/infile.asp' is not allowed.
    >
    > I know classic asp pages are allowed to run because in this asp.net
    > application, using e.g. window.location.href="myfile.asp" works.
    >
    > What do i have to change in the configuration of IIS 5.0 (or 6.0) to make
    > this run, or is it an asp.net issue?
    >
    > Thanks for help
    > Ben
    >
    >
    >
    >
    >
    >
    >
    bruce barker, Jul 3, 2007
    #4
  5. Ben

    Ben Guest

    In the configuration of IIS, in the list of the extentions, there is .ASP
    with following verbs:
    GET, POST, TRACE, HEAD ..

    so ...??

    "bruce barker" <> schreef in bericht
    news:...
    > location.href is a GET. the error means iis is not configred to allow post
    > to an asp application in the vdir. look at the mapping and add the POST
    > verb.
    >
    > -- bruce (sqlwork.com)
    >
    > Ben wrote:
    >> Hi,
    >>
    >> i try to submit a form in an aspx file through javascript to an classic
    >> asp page like this:
    >>
    >> <form id="ins" method="post">
    >> <input id="conn" name="conn" type="hidden" />
    >> <input runat="server" id="submit1" type="button"
    >> onclick="inexcel()"/>
    >> </form>
    >> <script language="javascript" type="text/javascript">
    >> function infilel()
    >> {
    >> document.getElementById("conn").value=conn
    >> document.getElementById("ins").action="infile.asp"
    >> document.getElementById("ins").submit()
    >> return true;
    >> }
    >>
    >> </script>
    >>
    >>
    >> i get the message: The HTTP verb POST used to access path
    >> '/enquete/infile.asp' is not allowed.
    >>
    >> I know classic asp pages are allowed to run because in this asp.net
    >> application, using e.g. window.location.href="myfile.asp" works.
    >>
    >> What do i have to change in the configuration of IIS 5.0 (or 6.0) to make
    >> this run, or is it an asp.net issue?
    >>
    >> Thanks for help
    >> Ben
    >>
    >>
    >>
    >>
    >>
    >>
    Ben, Jul 3, 2007
    #5
  6. Ben

    David Wang Guest

    IIS and ASP does not have error message that looks like:
    "The HTTP verb POST used to access path '/enquete/infile.asp' is not
    allowed"

    I would go down the ASP.Net configuration route.


    //David
    http://w3-4u.blogspot.com
    http://blogs.msdn.com/David.Wang
    //





    On Jul 3, 3:09 pm, "Ben" <b@bn> wrote:
    > In the configuration of IIS, in the list of the extentions, there is .ASP
    > with following verbs:
    > GET, POST, TRACE, HEAD ..
    >
    > so ...??
    >
    > "bruce barker" <> schreef in berichtnews:...
    >
    >
    >
    > > location.href is a GET. the error means iis is not configred to allow post
    > > to an asp application in the vdir. look at the mapping and add the POST
    > > verb.

    >
    > > -- bruce (sqlwork.com)

    >
    > > Ben wrote:
    > >> Hi,

    >
    > >> i try to submit a form in an aspx file through javascript to an classic
    > >> asp page like this:

    >
    > >> <form id="ins" method="post">
    > >> <input id="conn" name="conn" type="hidden" />
    > >> <input runat="server" id="submit1" type="button"
    > >> onclick="inexcel()"/>
    > >> </form>
    > >> <script language="javascript" type="text/javascript">
    > >> function infilel()
    > >> {
    > >> document.getElementById("conn").value=conn
    > >> document.getElementById("ins").action="infile.asp"
    > >> document.getElementById("ins").submit()
    > >> return true;
    > >> }

    >
    > >> </script>

    >
    > >> i get the message: The HTTP verb POST used to access path
    > >> '/enquete/infile.asp' is not allowed.

    >
    > >> I know classic asp pages are allowed to run because in this asp.net
    > >> application, using e.g. window.location.href="myfile.asp" works.

    >
    > >> What do i have to change in the configuration of IIS 5.0 (or 6.0) to make
    > >> this run, or is it an asp.net issue?

    >
    > >> Thanks for help
    > >> Ben- Hide quoted text -

    >
    > - Show quoted text -
    David Wang, Jul 4, 2007
    #6
  7. Ben, David :

    I constructed a simple page which proves that you can post
    to an ASP page from an ASPX page using PostBackUrl.

    See it working at :

    http://asp.net.do/test/cross-post.aspx

    Just write your name...and submit the form.
    The ASP page returns your name using Request.Form.

    Here's the code for the ASPX page :

    form ID= "Check" runat="server">
    Write your name:
    <asp:TextBox ID="Name" runat="server" />
    <asp:Button ID= "crosspost" Text="Post to an ASP page" runat="server" PostbackUrl="cross-posted.asp" />
    </form>

    Here's the code in "cross-posted.asp" :

    <%
    Response.Write Request.Form("Name") & "<BR>"
    %>

    It's very simple...and works fine.





    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    "David Wang" <> wrote in message news:...
    > IIS and ASP does not have error message that looks like:
    > "The HTTP verb POST used to access path '/enquete/infile.asp' is not
    > allowed"
    >
    > I would go down the ASP.Net configuration route.
    >
    >
    > //David
    > http://w3-4u.blogspot.com
    > http://blogs.msdn.com/David.Wang
    > //
    >
    >
    >
    >
    >
    > On Jul 3, 3:09 pm, "Ben" <b@bn> wrote:
    >> In the configuration of IIS, in the list of the extentions, there is .ASP
    >> with following verbs:
    >> GET, POST, TRACE, HEAD ..
    >>
    >> so ...??
    >>
    >> "bruce barker" <> schreef in berichtnews:...
    >>
    >>
    >>
    >> > location.href is a GET. the error means iis is not configred to allow post
    >> > to an asp application in the vdir. look at the mapping and add the POST
    >> > verb.

    >>
    >> > -- bruce (sqlwork.com)

    >>
    >> > Ben wrote:
    >> >> Hi,

    >>
    >> >> i try to submit a form in an aspx file through javascript to an classic
    >> >> asp page like this:

    >>
    >> >> <form id="ins" method="post">
    >> >> <input id="conn" name="conn" type="hidden" />
    >> >> <input runat="server" id="submit1" type="button"
    >> >> onclick="inexcel()"/>
    >> >> </form>
    >> >> <script language="javascript" type="text/javascript">
    >> >> function infilel()
    >> >> {
    >> >> document.getElementById("conn").value=conn
    >> >> document.getElementById("ins").action="infile.asp"
    >> >> document.getElementById("ins").submit()
    >> >> return true;
    >> >> }

    >>
    >> >> </script>

    >>
    >> >> i get the message: The HTTP verb POST used to access path
    >> >> '/enquete/infile.asp' is not allowed.

    >>
    >> >> I know classic asp pages are allowed to run because in this asp.net
    >> >> application, using e.g. window.location.href="myfile.asp" works.

    >>
    >> >> What do i have to change in the configuration of IIS 5.0 (or 6.0) to make
    >> >> this run, or is it an asp.net issue?

    >>
    >> >> Thanks for help
    >> >> Ben- Hide quoted text -

    >>
    >> - Show quoted text -

    >
    >
    Juan T. Llibre, Jul 4, 2007
    #7
  8. Ben

    David Wang Guest

    I don't think anyone was disproving your statement.

    I'm just saying that the error did not come from IIS/ASP, so the issue
    comes from how ASP.Net is used. That is certainly correct and not
    disproving anything else.

    Ben's example was not using PostBackUrl. Perhaps that is the issue...
    in which case all is well.


    //David
    http://w3-4u.blogspot.com
    http://blogs.msdn.com/David.Wang
    //




    On Jul 4, 6:07 am, "Juan T. Llibre" <> wrote:
    > Ben, David :
    >
    > I constructed a simple page which proves that you can post
    > to an ASP page from an ASPX page using PostBackUrl.
    >
    > See it working at :
    >
    > http://asp.net.do/test/cross-post.aspx
    >
    > Just write your name...and submit the form.
    > The ASP page returns your name using Request.Form.
    >
    > Here's the code for the ASPX page :
    >
    > form ID= "Check" runat="server">
    > Write your name:
    > <asp:TextBox ID="Name" runat="server" />
    > <asp:Button ID= "crosspost" Text="Post to an ASP page" runat="server" PostbackUrl="cross-posted.asp" />
    > </form>
    >
    > Here's the code in "cross-posted.asp" :
    >
    > <%
    > Response.Write Request.Form("Name") & "<BR>"
    > %>
    >
    > It's very simple...and works fine.
    >
    > Juan T. Llibre, asp.net MVP
    > asp.net faq :http://asp.net.do/faq/
    > foros de asp.net, en español :http://asp.net.do/foros/
    > ======================================
    >
    >
    >
    > "David Wang" <> wrote in messagenews:...
    > > IIS and ASP does not have error message that looks like:
    > > "The HTTP verb POST used to access path '/enquete/infile.asp' is not
    > > allowed"

    >
    > > I would go down the ASP.Net configuration route.

    >
    > > //David
    > >http://w3-4u.blogspot.com
    > >http://blogs.msdn.com/David.Wang
    > > //

    >
    > > On Jul 3, 3:09 pm, "Ben" <b@bn> wrote:
    > >> In the configuration of IIS, in the list of the extentions, there is .ASP
    > >> with following verbs:
    > >> GET, POST, TRACE, HEAD ..

    >
    > >> so ...??

    >
    > >> "bruce barker" <> schreef in berichtnews:...

    >
    > >> > location.href is a GET. the error means iis is not configred to allow post
    > >> > to an asp application in the vdir. look at the mapping and add the POST
    > >> > verb.

    >
    > >> > -- bruce (sqlwork.com)

    >
    > >> > Ben wrote:
    > >> >> Hi,

    >
    > >> >> i try to submit a form in an aspx file through javascript to an classic
    > >> >> asp page like this:

    >
    > >> >> <form id="ins" method="post">
    > >> >> <input id="conn" name="conn" type="hidden" />
    > >> >> <input runat="server" id="submit1" type="button"
    > >> >> onclick="inexcel()"/>
    > >> >> </form>
    > >> >> <script language="javascript" type="text/javascript">
    > >> >> function infilel()
    > >> >> {
    > >> >> document.getElementById("conn").value=conn
    > >> >> document.getElementById("ins").action="infile.asp"
    > >> >> document.getElementById("ins").submit()
    > >> >> return true;
    > >> >> }

    >
    > >> >> </script>

    >
    > >> >> i get the message: The HTTP verb POST used to access path
    > >> >> '/enquete/infile.asp' is not allowed.

    >
    > >> >> I know classic asp pages are allowed to run because in this asp.net
    > >> >> application, using e.g. window.location.href="myfile.asp" works.

    >
    > >> >> What do i have to change in the configuration of IIS 5.0 (or 6.0) to make
    > >> >> this run, or is it an asp.net issue?

    >
    > >> >> Thanks for help
    > >> >> Ben- Hide quoted text -

    >
    > >> - Show quoted text -- Hide quoted text -

    >
    > - Show quoted text -
    David Wang, Jul 4, 2007
    #8
  9. re:
    !> I don't think anyone was disproving your statement.

    No problem. I didn't think that was the case.
    I only wanted to provide the solution.

    re:
    !> Ben's example was not using PostBackUrl. Perhaps that is the issue...

    Indeed, it is the issue. Using PostBackUrl is the solution.



    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    "David Wang" <> wrote in message news:...
    I don't think anyone was disproving your statement.

    I'm just saying that the error did not come from IIS/ASP, so the issue
    comes from how ASP.Net is used. That is certainly correct and not
    disproving anything else.

    Ben's example was not using PostBackUrl. Perhaps that is the issue...
    in which case all is well.


    //David
    http://w3-4u.blogspot.com
    http://blogs.msdn.com/David.Wang
    //

    On Jul 4, 6:07 am, "Juan T. Llibre" <> wrote:
    > Ben, David :
    >
    > I constructed a simple page which proves that you can post
    > to an ASP page from an ASPX page using PostBackUrl.
    >
    > See it working at :
    >
    > http://asp.net.do/test/cross-post.aspx
    >
    > Just write your name...and submit the form.
    > The ASP page returns your name using Request.Form.
    >
    > Here's the code for the ASPX page :
    >
    > form ID= "Check" runat="server">
    > Write your name:
    > <asp:TextBox ID="Name" runat="server" />
    > <asp:Button ID= "crosspost" Text="Post to an ASP page" runat="server" PostbackUrl="cross-posted.asp" />
    > </form>
    >
    > Here's the code in "cross-posted.asp" :
    >
    > <%
    > Response.Write Request.Form("Name") & "<BR>"
    > %>
    >
    > It's very simple...and works fine.
    >
    > Juan T. Llibre, asp.net MVP
    > asp.net faq :http://asp.net.do/faq/
    > foros de asp.net, en español :http://asp.net.do/foros/
    > ======================================
    >
    >
    >
    > "David Wang" <> wrote in messagenews:...
    > > IIS and ASP does not have error message that looks like:
    > > "The HTTP verb POST used to access path '/enquete/infile.asp' is not
    > > allowed"

    >
    > > I would go down the ASP.Net configuration route.

    >
    > > //David
    > >http://w3-4u.blogspot.com
    > >http://blogs.msdn.com/David.Wang
    > > //

    >
    > > On Jul 3, 3:09 pm, "Ben" <b@bn> wrote:
    > >> In the configuration of IIS, in the list of the extentions, there is .ASP
    > >> with following verbs:
    > >> GET, POST, TRACE, HEAD ..

    >
    > >> so ...??

    >
    > >> "bruce barker" <> schreef in berichtnews:...

    >
    > >> > location.href is a GET. the error means iis is not configred to allow post
    > >> > to an asp application in the vdir. look at the mapping and add the POST
    > >> > verb.

    >
    > >> > -- bruce (sqlwork.com)

    >
    > >> > Ben wrote:
    > >> >> Hi,

    >
    > >> >> i try to submit a form in an aspx file through javascript to an classic
    > >> >> asp page like this:

    >
    > >> >> <form id="ins" method="post">
    > >> >> <input id="conn" name="conn" type="hidden" />
    > >> >> <input runat="server" id="submit1" type="button"
    > >> >> onclick="inexcel()"/>
    > >> >> </form>
    > >> >> <script language="javascript" type="text/javascript">
    > >> >> function infilel()
    > >> >> {
    > >> >> document.getElementById("conn").value=conn
    > >> >> document.getElementById("ins").action="infile.asp"
    > >> >> document.getElementById("ins").submit()
    > >> >> return true;
    > >> >> }

    >
    > >> >> </script>

    >
    > >> >> i get the message: The HTTP verb POST used to access path
    > >> >> '/enquete/infile.asp' is not allowed.

    >
    > >> >> I know classic asp pages are allowed to run because in this asp.net
    > >> >> application, using e.g. window.location.href="myfile.asp" works.

    >
    > >> >> What do i have to change in the configuration of IIS 5.0 (or 6.0) to make
    > >> >> this run, or is it an asp.net issue?

    >
    > >> >> Thanks for help
    > >> >> Ben- Hide quoted text -

    >
    > >> - Show quoted text -- Hide quoted text -

    >
    > - Show quoted text -
    Juan T. Llibre, Jul 4, 2007
    #9
  10. Ben

    Guest

    K
    , Jun 19, 2012
    #10
    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. Kenneth Myhra

    HTTP error 405 for 'PUT' verb

    Kenneth Myhra, Feb 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,070
    bruce barker
    Feb 17, 2004
  2. =?Utf-8?B?UmV6YSBTb2xvdWtp?=

    The web serve has been locked down and is blocking the Debug verb.

    =?Utf-8?B?UmV6YSBTb2xvdWtp?=, Nov 24, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    3,606
    Ben Strackany
    Nov 24, 2004
  3. Randy
    Replies:
    0
    Views:
    430
    Randy
    Mar 29, 2006
  4. Eric
    Replies:
    3
    Views:
    1,446
    Joerg Jooss
    Feb 27, 2007
  5. Iñaki Baz Castillo
    Replies:
    13
    Views:
    497
    Iñaki Baz Castillo
    May 1, 2011
Loading...

Share This Page