Calling RenderPartial from an Area

This is my folder structure.

alt text

I want to call a partial view from my view in my field

+5
source share
2 answers

You can 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 part from the folder Shared:

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

geocine, try this option.

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

Does your problem solve?

+1
source

All Articles