Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The HTTP verb POST used to access path '/' is not allowed

Tags:

asp.net

The entire error:

Server Error in '/' Application.

The HTTP verb POST used to access path '/' is not allowed.
Description: An unhandled exception occurred during the execution of the current 
web request. Please review the stack trace for more information about the error 
and where it originated in the code.

Exception Details: System.Web.HttpException: The HTTP verb POST used to access
path '/' is not allowed.

Source Error:

An unhandled exception was generated during the execution of the current web 
request. Information regarding the origin and location of the exception can be
identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): The HTTP verb POST used to access path '/' is not allowed.]
System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) +2871966
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8679410
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

To be honest, I'm not even sure where the error came from. I'm running Visual Studio 2008 through the Virtual Server. I just put a button:

<asp:Button ID="btnRegister" runat="server" Text="Register" 
                            CssClass="bt_register" onclick="btnRegister_Click" />

On a login user control, the onclick event is just a simple response.redirect

Response.Redirect("~/register.aspx");

Debugging the project, it isn't even hitting the btnRegister_Click method anyway. I'm not sure where to even begin with debugging this error. Any information will help. I can post all the code I have, but like I said, I'm not sure where this error is even being thrown at.

Edit

It has nothing at all to do with the button click event. I got rid of the method and the onclick parameter on the aspx page. Still coming up with the same error

problem found

Okay so this is for a school project and its a group project. Some one in my group thought it would be a good idea to wrap a form tag around this area telling it to post. Found it doing a diff with a revision on Google code.

like image 331
Ryan Avatar asked Dec 05 '09 04:12

Ryan


2 Answers

Are you rewriting URLs? it seems that there are problems with the url rewriting.

http://www.lukemelia.com/blog/archives/2007/01/05/aspnet-the-http-verb-post-used-to-access-path-is-not-allowed/

You have to remove the mapping of ‘*’ to aspnet_isapi.dll in yourIIS settings.

like image 154
Brij Avatar answered Nov 15 '22 06:11

Brij


While a Canvas URL value has to end in "/", the Tabl URL can be a fully qualified page (e.g. http://[DOMAIN/DIRECTORY-PATH]/Default.aspx).

I'm working locally, so http://localhost:4604/Main/Default.aspx worked for me.

like image 42
wloescher Avatar answered Nov 15 '22 06:11

wloescher