我有以下 jquery 在 div 中加载部分视图
var acc = this.id;
$('#details').load('/AccountAndTransaction/Grab', function (html)
{ $('#details')[0].value = html; });
它工作得很好,但现在我想用这个加载方法传递'var acc',我怎么能做到这一点?
控制器
[HttpGet]
public ActionResult Grab(string AccountNumber)
{
TermDepositAccountViewModel tdParent = new TermDepositAccountViewModel();
account ac = db.accounts.Single(u => u.accountNumber == AccountNumber);
deposittd td = db.deposittds.Single(u => u.accountNumber == AccountNumber);
tdParent.deposittd = td;
tdParent.account = ac;
return PartialView("TermDepositPartialView", tdParent);
}