我是新来的MVC剃刀。
我有这样的观点:
@model SuburbanCustPortal.Models.CustomerModel
@{
ViewBag.Title = "Customer Summary";
}
<h2>Customer Summary Screen</h2>
<p>
Please select an account below or add an existing account.
</p>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm())
{
@Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.")
<div>
<fieldset>
<legend>Existing Accounts</legend>
@Html.Action("ExistingAccounts2")
<p>
<input type="submit" value="Add an Account" />
</p>
</fieldset>
</div>
}
调用该方法:
[Authorize]
public ActionResult ExistingAccounts2()
{
return PartialView("ExistingAccounts", _client.RequestCustomersForAccount(User.Identity.Name));
}
这反过来又调用此部分观点:
@model IEnumerable<SuburbanCustPortal.SuburbanService.CustomerData >
<br />
<br />
<table>
@if (Model != null)
{
foreach (var usr in Model)
{
<tr>
<td>
<input id="btnShowCustomer" name="btnShowCustomer2" type="submit" value="View"/>
</td>
<td>
@usr.AccountId
</td>
<td>
@usr.Name
</td>
@* <td>
@usr.DeliveryStreet
</td>*@
</tr>
}
}
</table>
<br />
这最终显示此:
这工作了这一点。
我想这样是可以点击旁边的客户名称的按钮,并拉起了客户的帐户。
如何客户绑按钮知道谁拉涨以及如何有按钮,点击拉起?