Render partial from different folder (not shared)

Just include the path to the view, with the file extension. Razor: @Html.Partial(“~/Views/AnotherFolder/Messages.cshtml”, ViewData.Model.Successes) ASP.NET engine: <% Html.RenderPartial(“~/Views/AnotherFolder/Messages.ascx”, ViewData.Model.Successes); %> If that isn’t your issue, could you please include your code that used to work with the RenderUserControl?

Razor: @Html.Partial() vs @RenderPage()

Html.Partial(“MyView”) Renders the “MyView” view to an MvcHtmlString. It follows the standard rules for view lookup (i.e. check current directory, then check the Shared directory). Html.RenderPartial(“MyView”) Does the same as Html.Partial(), except that it writes its output directly to the response stream. This is more efficient, because the view content is not buffered in memory. … Read more

Html.Partial vs Html.RenderPartial & Html.Action vs Html.RenderAction

Html.Partial returns a String. Html.RenderPartial calls Write internally and returns void. The basic usage is: // Razor syntax @Html.Partial(“ViewName”) @{ Html.RenderPartial(“ViewName”); } // WebView syntax <%: Html.Partial(“ViewName”) %> <% Html.RenderPartial(“ViewName”); %> In the snippet above, both calls will yield the same result. While one can store the output of Html.Partial in a variable or return … Read more