在一个view中(不妨设为category.cshtml),有companyid和productid两个参数要传回相应的product控制器的details方法中处理,即
public ActionResult Details()
{
//根据传回来的companyid和productid查询数据库,并在detail.cshtml中显示。
}
问题是,我在这个action中如何获得category.cshtml中传回的companyid和productid参数呢?换句话问,就是在category.cshtml中用什么方法将这两个参数传给Details这个action?
public ActionResult Details()
{
//根据传回来的companyid和productid查询数据库,并在detail.cshtml中显示。
}
问题是,我在这个action中如何获得category.cshtml中传回的companyid和productid参数呢?换句话问,就是在category.cshtml中用什么方法将这两个参数传给Details这个action?
是这样用吗?但似乎只能传回一个参数啊。
使用@Html.BeginForm来提交表单另外@Url.RouteUrl()可以带很多参数:
@Url.RouteUrl({action="", controller="", fId="", fName=""}),参数关键字随意指定。