I have a partial that is used in several views. The partial contains forms. The action when a form is submited is allways the same, but the controller thats contains the act
ViewContext's RouteData property contains names of current controller and action. You could use them like this:
Html.BeginForm("ActOnChoosenPerson", ViewContext.RouteData.
GetRequiredString("controller"))
The easiest way to do this would be to simply call BeginForm() with no parameters.
This code will always give your current controller
<%=( Url.RequestContext.RouteData.GetRequiredString("Controller")) %>
Obviously you can use it without the <%= like this
Html.BeginForm(
Url.RequestContext.RouteData.GetRequiredString("Controller")) ,
"ActOnChoosenPerson")
It looks more clunky but your model should not need to know what controller is calling it.