views:

100

answers:

1

If I call RenderAction on action method which view has Html.BeginForm() with no params my form action folows the parent url.

If I add any param (route values, action, etc) , form action attribute is replaced with MyChildContorller's controller name and action.

How to use RenderAction without affecting parent url?

A: 

Html.BeginForm() simply puts Request.Url.ToString() in the form action parameter. When you use Html.BeginForm("actionName", "controllerName") routing will be used to calculate the url.

Darin Dimitrov