How do you include .html or .asp file using razor?

后端 未结 14 1501
说谎
说谎 2020-12-14 01:09

Is it possible to use server side include in Razor view engine to include .html or .asp file? We have an .html file and .asp files that contain website menus that are used

14条回答
  •  萌比男神i
    2020-12-14 01:21

    Why not include a section within your _Layout.cshtml page that will allow you to render sections based on what menu you want to use.

    _Layout.cshtml

    
    @RenderSection("BannerContent")
    
    

    Then, in any page that uses that layout, you will have something like this:

    @section BannerContent 
    {
      @*Place your ASP.NET and HTML within this section to create/render your menus.*@
    }
    

提交回复
热议问题