ASP.Net MVC - 资源无法找到错误 - 第一次

时间:2014-01-21 12:47:45

标签: asp.net asp.net-mvc

美好的一天!

我正在编写一个非常简单的asp mvc 4 app,它是一个简单的静态站点。 当我从网站向应用程序发送请求时 - 我在第一次尝试时收到以下错误:

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应用程序。

1 个答案:

答案 0 :(得分:1)

在MVC应用程序中,我们无法在浏览器url中编写.aspx扩展名。在mvc应用程序视图页面扩展名是.cshtml,所以请在浏览器URL中删除.aspx扩展名。

您要求的网址可能是这样的http:localhost / EmailSendApp / login 所以你的请求被发送到EmailSendApp控制器中的登录方法