整个错误:
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
老实说,我什至不确定错误来自哪里。我通过虚拟服务器运行 Visual Studio 2008。我只是放了一个按钮:
<asp:Button ID="btnRegister" runat="server" Text="Register"
CssClass="bt_register" onclick="btnRegister_Click" />
在登录用户控件上,onclick 事件只是一个简单的response.redirect
Response.Redirect("~/register.aspx");
调试项目时,它甚至没有调用 btnRegister_Click 方法。我不知道从哪里开始调试这个错误。任何信息都会有帮助。我可以发布我拥有的所有代码,但就像我说的,我不确定这个错误是在哪里抛出的。
Edit
它与按钮单击事件完全无关。我去掉了 aspx 页面上的方法和 onclick 参数。仍然出现同样的错误
发现问题
好的,这是一个学校项目,也是一个小组项目。我小组中的一些人认为最好在该区域周围加上一个表单标签,告诉它要发布。发现它与 Google 代码的修订版进行了比较。
您正在重写 URL 吗?
看来是url重写有问题。
http://www.lukemelia.com/blog/archives/2007/01/05/aspnet-the-http-verb-post-used-to-access-path-is-not-allowed/
您必须在 IIS 设置中删除“*”到 aspnet_isapi.dll 的映射。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)