0
我有一個表格:ASP MVC 3如何將字段從表單映射到對象?
<form method="POST" action="test">
<input type="text" name="personFirstName" />
<input type="text" name="personLastName" />
...
</form>
另外,我下課時:
[Serializable]
public class Person
{
public string FirstName {get;set;}
public string LastName {get;set;}
}
和我有ActionResult的:
public ActionResult(Person p)
{
...
}
所以H ow在序列化Person對象中的表單而不重命名錶單中的「名稱」?有沒有別名屬性? (personFirstName - >名字,personLastName - >姓氏)