Including static html file from ~/Content into ASP.NET MVC view

后端 未结 6 1190
长情又很酷
长情又很酷 2020-12-16 14:18

I\'ve got master page in my project, which contains some information about site copyright and some contact info in it. I\'d like to take it out of master page and place it i

6条回答
  •  遥遥无期
    2020-12-16 14:33

    Is there a reason you are holding the content in an HTML file rather than a partial view?

    If you create a file called snippet.ascx in your Views/Shared folder you can import the content of that snippet.ascx file into any view by using <% Html.RenderPartial("snippet"); %>

提交回复
热议问题