2009-12-05 122 views
5

整个错误:用于访问路径的HTTP动词POST“/”是不允许的

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代码上进行了修订并进行了差异化。

+0

我有同样的错误,并修复它,如果你想获取一个html文件的内容,重命名为aspx,因为它是不允许的 – Kubi 2012-01-05 08:56:39

回答

3

虽然Canvas URL值必须以“/”结尾,但Tabl URL可以是完全限定的页面(例如http:// [DOMAIN/DIRECTORY-PATH] /Default.aspx)。

我在本地工作,所以http:// localhost:4604/Main/Default.aspx为我工作。

+0

在尝试了很多差异化解决方案之后,在使用VS2010服务器时,这个解决方案适用于我。简单。谢谢 – Guy 2012-09-22 05:43:49

相关问题