Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm calling a SurfaceController from a PartialMacro and want to pass a parameter to the controller. Something like:
@inherits Umbraco.Web.Macros.PartialViewMacroPage @{ int FolderId = 1096; Html.Action("Index", "DocumentListSurface", FolderId); }
Picked up in the Controller with:
public ActionResult Index(int FolderId)
The Html.Action in the PartialMacro gets an error.
What am I doing wrong?
Your help would be much appreciated.
Thanking you in anticipation.
Roger
Hi Roger, Wouldn't you need to wrap the route values (FolderId) in a typeless object?
example:
Html.Action("Index", "DocumentListSurface", new { FolderId });
There shouldn't be any need to do
Html.Action("Index", "DocumentListSurface", new { FolderId = FolderId });
As the local parameter name matches the route parameter name already. I hope that helps.
Thanks, Jamie
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Pass a parameter to a controller
I'm calling a SurfaceController from a PartialMacro and want to pass a parameter to the controller. Something like:
Picked up in the Controller with:
The Html.Action in the PartialMacro gets an error.
What am I doing wrong?
Your help would be much appreciated.
Thanking you in anticipation.
Roger
Hi Roger,
Wouldn't you need to wrap the route values (FolderId) in a typeless object?
example:
There shouldn't be any need to do
As the local parameter name matches the route parameter name already. I hope that helps.
Thanks,
Jamie
is working on a reply...