Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
hi I am download a template that call a html page like

<header class="bg-dark" data-load="header.html"></header>

can i call same html page("header.html")in Mvc on layout page.

Please Healp me
Posted
Updated 26-Jun-14 1:40am

by creating a partial view, write the html of heder.html on partial view.
<header class="bg-dark" >
                @Html.Partial("~/Views/Shared/_header.cshtml")
 
Share this answer
 
I think you have to put the corresponding relative path by using Razor Url helper.

Try this:

@Url.Content("~/folder/anotherfolder/header.html")


So the complete header should be something like this:

<header class="bg-dark" data-load="@Url.Content("~/folder/anotherfolder/header.html")"></header>


I hope It helps.

SoFarSoGood!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900