整個錯誤:用於訪問路徑的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代碼上進行了修訂並進行了差異化。
我有同樣的錯誤,並修復它,如果你想獲取一個html文件的內容,重命名爲aspx,因爲它是不允許的 – Kubi 2012-01-05 08:56:39