原本aspx是这样写的,#include file="111.png"请问cshtml 要达到同样的效果···是怎么写?

解决方案 »

  1.   

    cshtml可以用局部模版
    @html.RenderPartial("另一个view.cshtml")
      

  2.   

    #include   file 包含一个资源mvc里面你可以 @html.action指向一个资源,同等效果。
      

  3.   

    @Html.Partial("~/Views/Shared/顶部模板.cshtml")
      

  4.   

    与其花500在这里问,不如自己好好看看aspx和razor引擎的基本语法。。
      

  5.   

    <img src="@Url.Content("~/Content/newImg/pacific_logo.png")" class="logo" />