How can I pass parameters to an Action using Html.Action() in ASP.NET MVC?


How can I pass parameters to an Action using Html.Action() in ASP.NET MVC?



I've been using Html.Action("ActionName", "ControllerName") to invoke child actions across controllers without needing to have the view in Views\Shared. This has been working great for displaying things like session or cookie information.

Instead of just accessing cookies, I would like to pass additional parameters to Html.Action("ActionName", "ControllerName") so the action can execute different code based on the the data passed to the original view.

Should I be using a different method to pass parameters to a child action in a different controller? How would one accomplish this?


Routing based on requested datatype in ASP.NET MVC

1:

jquery selection problem
You could specify additional data in the RouteValues property like this.. ASP.net MVC - Stop page rendering until JQuery finished
Html.Action("Controller","Name", new { id = 1 }) 
Tricking ASP.NET into Thinking Request is Ajax Request for jQuery File UploadHow to get the Model.Value in my View. using asp.net mvc

2:

How can I validate a ViewModel in jQuery Dialog?
To add a little on this question, I am using ASP.Net MVC 5 and I could succeed to achieve this with this code: . Why is IIS 7 showing me a default 403 page?
@Html.Action("foo",new {parameter1=1}) 
jquery ckeditor language dir

67 out of 100 based on 42 user ratings 277 reviews