0

I have a date label template in ~/Views/Shared/DisplayTemplates/Date.vbhtml.

If in a controller I call Return PartialView("MyPartial", result) the date controls in the partial view will be replaced by my custom date template. And everything works correctly. This is the case where the partial path is resolved by the engine.

But if in the controller I call Return PartialView("~/Views/MyController/MyPartial.vbhtml", result). Then the custom display templates are never called. However if I put the display templates in ~/Views/MyController/DisplayTemplates/Date.vbhtml then it works again.

So my problem is I need the partial views that are specified with an absolute path to find the DisplayTemplates in the ~/Views/Shared/DisplayTemplates/ folder. It seems like for some reason when there is an absolute path is doesn't bother to check the shared folder?

2

0

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.