2014-01-21 61 views
2

美好的一天!ASP.Net MVC - 資源無法找到錯誤 - 第一時間

我在寫一個非常簡單的asp mvc 4應用程序,它是一個簡單的靜態網站。 當我發送從網站的請求的應用程序 - 我得到我的第一次嘗試以下錯誤:

The resource cannot be found. 
Description: HTTP 404. The resource you are looking for 
(or one of its dependencies) could   have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. 

Requested URL: /EmailSendApp/login.aspx 

在我的第二次嘗試,我點擊「發送」和我的應用效果很好!

爲什麼第一次不工作?

謝謝!

這是Intranet網站,我使用Windows授權。

這是帶有Windows授權的ASP MVC應用程序。

+5

這是一個MVC的網站?如果是這樣,爲什麼我們需要一個ASPX擴展?你也意味着從網站發送請求到應用程序?請更好地格式化您的問題。 – ramiramilu

回答

1

在MVC應用程序中,我們無法在瀏覽器url中編寫.aspx擴展名。在mvc應用程序中,viewpage擴展名爲.cshtml,所以請刪除瀏覽器url中的.aspx擴展名。

你請求的URL可以是這樣的http:本地主機/ EmailSendApp /登錄 所以你的請求被髮送到登錄方法,它存在於EmailSendApp控制器