Using custom VirtualPathProvider to load embedded resource Partial Views

前端 未结 3 654
南笙
南笙 2020-11-29 18:55

I wrote custom VirtualFile and VirtualPathProvider implementations that are successfully obtaining embedded resources that are Partial Views.

However, when I attempt

3条回答
  •  遥遥无期
    2020-11-29 19:41

    Because now you are serving your views from some unknown location there is no longer the ~/Views/web.config file which applies and indicates the base class for your razor views (). So you could add an @inherits directive at the top of each embedded view to indicate the base class.

    @inherits System.Web.Mvc.WebViewPage
    @model ...
    

提交回复
热议问题