Render partial from different folder (not shared)

前端 未结 10 2016
名媛妹妹
名媛妹妹 2020-11-29 17:12

How can I have a view render a partial (user control) from a different folder? With preview 3 I used to call RenderUserControl with the complete path, but whith upgrading to

10条回答
  •  时光说笑
    2020-11-29 17:27

    For readers using ASP.NET Core 2.1 or later and wanting to use Partial Tag Helper syntax, try this:

    
    

    The tilde (~) is optional.

    The information at https://docs.microsoft.com/en-us/aspnet/core/mvc/views/partial?view=aspnetcore-3.1#partial-tag-helper is helpful too.

提交回复
热议问题