2

Admin/Dashboard.cshtml:

<partial name="Partials/_Dash.cshtml" />

I'm trying to create a partial view _Dash.cshtml menu for the dashboard panel. However, I'm getting the following error:

Error:

An unhandled exception occurred while processing the request.
InvalidOperationException: The partial view 'Partials/_Dash.cshtml' was not found. The following locations were searched:
/Views/Admin/Partials/_Dash.cshtml

Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper.ProcessAsync(TagHelperContext context, TagHelperOutput output)

I already have Partial View _Menu which is called in _Layout:

<partial name="Partials/_Menu.cshtml" />

and it's working fine.

What could be the problem?

1 Answer 1

2

I always use the full path for a view that is not in default folder

<partial name="~/Views/..... /Partials/_Dash.cshtml" />

or you can move the partial view in a Shared folder, in this case

<partial name="_Dash" />
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.