ASP。第一次无法找到错误的资源

时间:2022-10-19 21:27:00

Good day!

美好的一天!

I'm writing a very simple asp mvc 4 app which is a simple static site. When i send a request from the site to app - I get the following error on my first attempt:

我正在编写一个非常简单的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

On my second attempt, i click "send" and my app works well!

在我第二次尝试的时候,我点击了“发送”,我的应用程序运行得很好!

Why is it not working the first time?

为什么它不是第一次起作用?

Thank you!

谢谢你!

It is Intranet site and i use Windows authorization.

它是内部网站点,我使用Windows授权。

It is ASP MVC application with Windows authorization.

它是具有Windows授权的ASP MVC应用程序。

1 个解决方案

#1


1  

In MVC application we cannot write .aspx extension in browser url.In mvc application viewpage extension is .cshtml so please remove .aspx extension in browser url.

在MVC应用程序中,我们不能在浏览器url中写入.aspx扩展。在mvc应用程序的视图扩展是。cshtml因此请在浏览器url中删除。aspx扩展。

Your requested url could be like this http:localhost/EmailSendApp/login so your request is sent to login method which is present in EmailSendApp controller

您所请求的url可以是这样的http:localhost/EmailSendApp/login,因此您的请求被发送到EmailSendApp controller中的login方法

#1


1  

In MVC application we cannot write .aspx extension in browser url.In mvc application viewpage extension is .cshtml so please remove .aspx extension in browser url.

在MVC应用程序中,我们不能在浏览器url中写入.aspx扩展。在mvc应用程序的视图扩展是。cshtml因此请在浏览器url中删除。aspx扩展。

Your requested url could be like this http:localhost/EmailSendApp/login so your request is sent to login method which is present in EmailSendApp controller

您所请求的url可以是这样的http:localhost/EmailSendApp/login,因此您的请求被发送到EmailSendApp controller中的login方法