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

后端 未结 6 1200
长情又很酷
长情又很酷 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:37

    You are better off using a partial view (even if it only contains static text) and include it with the Html.Partial helper. But if you insist:

    <%= File.ReadAllText(Server.MapPath("~/Content/snippet.html")) %>
    

提交回复
热议问题