.net mvc2 Html.RenderAction 如何传递参数?
<div id="tabs-3">
<% Html.RenderAction("notice_add", "admin");%>
</div>
可以加载action,但我需要传递一个参数过去,形如 http://localhost:3528/admin/notice_add/1如何把1传递过去呢?
查了文档,
//
// 摘要:
// Invokes the specified child action method using the specified parameters
// and controller name and renders the result inline in the parent view.
//
// 参数:
// htmlHelper:
// The HTML helper instance that this method extends.
//
// actionName:
// The name of the child action method to invoke.
//
// controllerName:
// The name of the controller that contains the action method.
//
// routeValues:
// An object that contains the parameters for a route. You can use routeValues
// to provide the parameters that are bound to the action method parameters.
// The routeValues parameter is merged with the original route values and overrides
// them.
//
// 异常:
// System.ArgumentNullException:
// The htmlHelper parameter is null.
//
// System.ArgumentException:
// The actionName parameter is null or empty.
//
// System.InvalidOperationException:
// The required virtual path data cannot be found.
public static void RenderAction(this HtmlHelper htmlHelper, string actionName, string controllerName, object routeValues);
routeValues 如何传?
我尝试: <% Html.RenderAction("notice_add", "admin","1");%>
但1并没有传入到action中,请问如何解决?
另外asp.net mvc api,在哪里,没有找到哦。