【发布时间】:2015-05-23 22:26:09
【问题描述】:
第一次在 Visual Studio 上使用 asp.net 和 MVC4 试图创建一个简单的表单供客户输入航班预订分配的详细信息,并出现此错误(如下所示)。
我似乎无法修复它,老实说不知道在哪里寻找修复它。是否有另一种方法可以创建更简单的表单,或者有人可以帮助解决这个问题吗?
查看:
@model WebsiteApplicationASSES.Models.customerdetails
@{
ViewBag.Title = "customerBooking";
}
<!DOCTYPE html />
<html></html>
</div>
<div>
@using (Html.BeginForm())
{
<table>
<tr>
<td> @Html.Label ("First Name:")</td>
<td> @Html.TextBoxFor (x=>x.customerFirstName)</td>
</tr>
}
型号:
namespace WebsiteApplicationASSES.Models
{
public class customerdetails
{
public string customerFirstName { set; get; }
public string customerSecondName { set; get; }
public int customerAge { set; get; }
public int customerTelephoneNumber { set; get; }
public string customerEmail { set; get; }
public int numberOfPassangers { set; get; }
public int passangersAge { set; get; }
}
}
""
谢谢!
【问题讨论】:
-
你有什么错误?
-
您忘记指定错误。
标签: html asp.net-mvc-4 model-view-controller