我想简单地从表单中获取数据。下面是我的表单。在我的控制器中,我如何访问表单中的数据?
<script type="text/javascript">
$(document).ready(function () {
$("#SavePersonButton").click(function () {
$("#addPerson").submit();
});
});
</script>
<h2>Add Person</h2>
<form id="addPerson" method="post" action="<%: Url.Action("SavePerson","Prod") %>">
<table>
<tr>
<td colspan="3" class="tableHeader">New Person</td>
</tr>
<tr>
<td colspan="2" class="label">First Name:</td>
<td class="content">
<input type="text" maxlength="20" name="FirstName" id="FirstName" />
</td>
</tr>
<tr>
<td colspan="2" class="label">Last Name:</td>
<td class="content">
<input type="text" maxlength="20" name="LastName" id="LastName" />
</td>
</tr>
<tr>
<td colspan="3" class="tableFooter">
<br />
<a id ="SavePersonButton" href="#" class="regularButton">Add</a>
<a href="javascript:history.back()" class="regularButton">Cancel</a>
</td>
</tr>
</table>
</form>
控制器 控制器 控制器 控制器 控制器
[HTTP POST]
public Action Result(Could i pass in the name through here or..)
{
Can obtain the data from the html over here using Request.Form. Pleas help
return RedirectToAction("SearchPerson", "Person");
}