Reuse Razor Partial View with Form

898 Views Asked by At

I have a partial view that has a form to post to a controller. I can include it into another view using @Html.RenderPartial.

The problem is that the parent view is linked with another controller. And the partial view post to its orginal controller.

Is it possible and how to write partial views with form that supports reuse?

Thanks,

1

There are 1 best solutions below

1
On BEST ANSWER

You can pass the form's action url (or action name) as a parameter to the partial view.