Search code examples
c#.netasp.net-mvc-2renderpartial

Calling RenderPartial from an Area


This is my folder structure

alt text

I wan to call a partialview from my view on my area


Solution

  • You could specify the full location of the view when rendering it:

    <% Html.RenderPartial("~/Areas/User/Views/SomeController/Foo.ascx"); %>
    

    UPDATE:

    And in order to call a partial from the Shared folder:

    <% Html.RenderPartial("~/Views/Shared/Foo.ascx"); %>