如何将参数传递给MVC3(razor)中的局部视图.我在我的MVC项目中用部分视图替换了常规的View页面.对于常规的View页面,我传递了类似的参数
public ActionResult MeanQ(int id) { Access access= db.Access.Find(id); return View(access); }
现在,因为我将视图更改为部分视图,所以我改为使用以下代码:
public ActionResult MeanQ(int id) { Access access= db.Access.Find(id); return PartialView("_MeanQPartial"); }
但是我不知道如何仍然传递参数’id’以使其像以前一样工作.请帮忙.它的价值,视图或部分视图,都由链接触发并显示在Jquery模式对话框中.
解决方法
试试这个
return PartialView("PartialViewName",access);
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。