I thought this was going to be straight forward but I managed to hose it up some how. If I want to pass URL parameters to another action do I have to create a new route for that?
controller
[ChildActionOnly]
public ActionResult ContentSection(string sectionAlias, string mvcController, string mvcAction = null)
view
@Html.RenderAction("ContentSection", "Portal", new {sectionAlias = "TermsAndConditions", mvcController = "Portal", mvcAction = "ChoosePayment"})
error
CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments
The problem here is that
Is the equivalent to
In the the Webforms
ViewEngine(which is also the same aResponse.Write). SinceRenderActionreturnsvoid, you cannotResponse.Writeit. What you want to do is this:The
@{ }syntax signifies a code block in the Razor view engine, which would be equivalent to the following the the WebformsViewEngine: