我認爲這將是直線前進,但我設法軟管它一些如何。如果我想將URL參數傳遞給另一個操作,我是否必須爲此創建一個新的路由?ASP.Net MVC如何通過使用Html.RenderAction網址參數的ChildAction
控制器
[ChildActionOnly]
public ActionResult ContentSection(string sectionAlias, string mvcController, string mvcAction = null)
視圖
@Html.RenderAction("ContentSection", "Portal", new {sectionAlias = "TermsAndConditions", mvcController = "Portal", mvcAction = "ChoosePayment"})
錯誤
CS1502: The best overloaded method match for 'System.Web.WebPages.WebPageExecutingBase.Write(System.Web.WebPages.HelperResult)' has some invalid arguments
或者你可以撥打@ Html.Action(...),而不是爲了稱呼其爲返回的內容的方法(如果你不喜歡使用大括號等) – 2011-02-11 00:33:38