Is there a way to pass a piece of extra data along with a model to a Partial view?
E.G.
@Html.Partial(\"_SomeTable\", (List
I came across this issue as well. I wanted to have a snippet of code reproduced many times, and did not want to copy paste. The code would vary slightly. After looking at the other answers, I did not want to go that exact route and decided instead to just use a plain Dictionary.
For example:
parent.cshtml
@{
var args = new Dictionary();
args["redirectController"] = "Admin";
args["redirectAction"] = "User";
}
@Html.Partial("_childPartial",args)
_childPartial.cshtml
@model Dictionary
@Model["redirectController"]
@Model["redirectAction"]