Razor Layout from another assembly

前端 未结 2 409
说谎
说谎 2021-01-18 15:24

Is it possible to use a layout from another assembly? I spitted up my application in different layers and have a separated UI layer which contains the master layout for the

相关标签:
2条回答
  • 2021-01-18 16:03

    You may take a look at the following article which illustrates a technique allowing you to have Razor views embedded into a separate assembly.

    0 讨论(0)
  • 2021-01-18 16:10

    At the end by the time you run the website, you need to gather all the views including layouts to a known place.

    In this case you can copy the shared views under root

    <siteroot>/Views/Shared/
    

    With this assumption you can refer these layouts the way you are doing. However visual studio or tools like resharper keep showing this as an error. You need to get comfortable with those errors.

    0 讨论(0)
提交回复
热议问题