我使用带有razor语法的html,css,c#进行了小项目。
我有布局页面(在剪刀文件夹上),我使用了renderbody()。
在布局页面上,我想要在所有页面上显示一个图像(“intro.png”)(因为我将图像放在布局页面上),但是当我在我的小网站上转到其他页面时页面不是apeear,它只出现在第一页上。 这是我的布局页面的一部分:
<!-- Introduction -->
<header>
<h2>head?</h2>
</header>
<p>some text.</p>
<img src="Content/images/intro.png">
</section>
<div id="content">
@RenderBody()
<aside>
<section>
<header>
<h3>Categories</h3>
</header>
</section>
<section>
<header>
<h3>Archives</h3>
</header>
<ul>
<li><a href="#">December 2008</a></li>
<li><a href="#">January 2009</a></li>
<li><a href="#">February 2009</a></li>
<li><a href="#">March 2009</a></li>
</ul>
</section>
</aside>
</div>
答案 0 :(得分:0)
而不是以这种方式提供图像链接:
<img src="Content/images/intro.png">
使用此:
<img src=@Url.Content("~/Content/images/intro.png")>
我认为Image Path存在问题。我认为上面的答案将解决这个问题..