【发布时间】:2011-04-27 23:45:20
【问题描述】:
整个错误:
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 方法。我不知道从哪里开始调试这个错误。任何信息都会有所帮助。我可以发布我拥有的所有代码,但就像我说的,我不确定这个错误是在哪里引发的。
编辑
它与按钮单击事件完全无关。我摆脱了aspx页面上的方法和onclick参数。仍然出现同样的错误
发现问题
好的,这是一个学校项目和一个小组项目。我小组中的一些人认为在这个区域周围包裹一个表单标签来告诉它发布是个好主意。发现它与 Google 代码的修订版存在差异。
【问题讨论】:
-
我有同样的错误并修复它,如果你试图获取 html 文件的内容,请将其重命名为 aspx,因为它是不允许的
标签: asp.net