Reference Partial View from area

Hello,

I have a partial view located in my root directory /Views/Partials/PartialViewName.cshtml

I have an area and inside that area i need to reference the partial view but I keep getting the error Partial view can’t be found.

Can someone tell me how to reference it correctly I have tried

@(Html.Partial("…/ProjectName/Views/Partials/ImportantInformation.cshtml"))

@(Html.Partial("~/ProjectName/Views/Partials/ImportantInformation.cshtml"))

@(Html.Partial("../../ProjectName/Views/Partials/ImportantInformation.cshtml"))

All with no luck

Hi,

Try like this:

@(Html.Partial("~/Views/Partials/ImportantInformation.cshtml"))

or check this site, may help u:

http://stackoverflow.com/questions/4390045/asp-net-mvc-render-a-partial-view-from-an-area

Hi Raju dasa,

Still not working…..

Hi Harrison,

Thanks for your reply.

According to your description,

Harrison.Scott

Still not working…..

What’s the error?please check Reference Path if correct.

Try this:

@(Html.Partial("~/Views/Partials/ImportantInformation.cshtml", Model))

Why would I need to pass a model to it? Its just plain HTML code, it doesn’t require a model,

The error is it doesn’t load on the page for some peculiar reason

Leave a Reply