I am trying to use the ViewBag to display the action for a form in a partial page.
I have tried the following:
@using(Html.BeginForm(ViewBag.Action, "Person", FormMethod.Post)
@using(Html.BeginForm((ViewBag.Action), "Person", FormMethod.Post)
@using(Html.BeginForm(@(ViewBag.Action), "Person", FormMethod.Post)
@using(Html.BeginForm({ViewBag.Action}, "Person", FormMethod.Post)
But none of those work. What is the correct syntax?
Try