我是新来的MVC 3,我试图添加一个图像到_Layout.cshtml文件。 我试过MVC 3 - _Layout.cshtml。在网站添加徽标
<img runat="server" id="img_logo" alt="Logo" src="Content/Images/mailworks.png" />
没有成功。该徽标仅出现在某些视图上。在其他人的意见出于某种原因图像应该是在其他地方 - 使用萤火虫发现它。
我是新来的MVC 3,我试图添加一个图像到_Layout.cshtml文件。 我试过MVC 3 - _Layout.cshtml。在网站添加徽标
<img runat="server" id="img_logo" alt="Logo" src="Content/Images/mailworks.png" />
没有成功。该徽标仅出现在某些视图上。在其他人的意见出于某种原因图像应该是在其他地方 - 使用萤火虫发现它。
试试这个:
<img id="img_logo" alt="Logo" src="@Url.Content("~/Content/Images/mailworks.png")" />
使用此:
<img src="@Url.Content("~/Content/Images/mailworks.png")"...
you miss /,.... –
你是对的。固定。谢谢 –
尝试
–
Timeless
RUNAT = “服务器” - 不需要在MVC – Mediator