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 - >姓氏)