Asp.net mvc MVC显示数据

Asp.net mvc MVC显示数据,asp.net-mvc,Asp.net Mvc,遵循本MVC教程,但无法在输入数据后显示display customer视图。我看不出我做错了什么 这是我的客人 <div> <form action="DisplayCustomer.aspx" method="post"> Enter Customer Code: <input type="text" name="CustomerCode" /><br /> Enter Cu

遵循本MVC教程,但无法在输入数据后显示display customer视图。我看不出我做错了什么

这是我的客人

<div>
          <form action="DisplayCustomer.aspx" method="post">
            Enter Customer Code: <input type="text" name="CustomerCode" /><br />
            Enter Customer Name: <input type="text" name="CustomerName" /><br />
            Ennter Customer Amout: <input type="text" name="CustomerAmount" /><br />
            <input type="submit" value="Submit customer data" />
          </form>
    </div>
然后


客户的姓名是:

客户的代码为:
退还给客户的金额为:
看起来台阶有点不对劲

我在尝试时遇到了这个错误

“/”应用程序中出现服务器错误。 找不到资源。 描述:HTTP404。您正在查找的资源(或其依赖项之一)可能已被删除、名称已更改或暂时不可用。请检查以下URL并确保其拼写正确

请求的URL:/customer/DisplayCustomer.aspx



版本信息:Microsoft.NET Framework版本:4.0.30319;ASP.NET版本:4.0.30319.17929

请求的正确路径是
/customer/displaycuster


.aspx
扩展以不同的方式处理,因此MVC路由引擎永远不会启动,并且由于该路径上不存在该页面,因此导致404错误。

您实际上需要删除.aspx扩展。只需以/Customer/displaycuster的身份请求页面

另外,您可能还需要更新表单并删除aspx扩展名,例如:

<form action="DisplayCustomer" method="post">
Enter customer id :- <input type="text" name="Id" /> <br />
Enter customer code :- <input type="text" name="CustomerCode" /><br />
Enter customer Amount :-<input type="text" name="Amount" /><br />
<input type="submit" value="Submit customer data" />
</form>

输入客户id:-
输入客户代码:-
输入客户金额:-
替换该行:

<form action="DisplayCustomer.aspx" method="post">


现在可以正常工作了。为什么当我删除.aspx时,visual studio显示找不到该文件。
<form action="DisplayCustomer" method="post">
Enter customer id :- <input type="text" name="Id" /> <br />
Enter customer code :- <input type="text" name="CustomerCode" /><br />
Enter customer Amount :-<input type="text" name="Amount" /><br />
<input type="submit" value="Submit customer data" />
</form>
<form action="DisplayCustomer.aspx" method="post">
<form action="DisplayCustomer" method="post">