Using Html instead of csHtml

前端 未结 5 2123
我寻月下人不归
我寻月下人不归 2020-12-16 12:46

I want to use pure html page instead of cshtml with MVC .net. But when I add view by right clicking Index i can see only two options.

 public class HomeContr         


        
5条回答
  •  一生所求
    2020-12-16 13:31

    You can create a View with a regular cshtml file add it to the controller and in the View itself just use pure html and add the following to the top:

    @{
        Layout = null;
    }
    

    This way you use a cshtml file that doesn't use you master layout file. And just serves whatever html you put in it.

提交回复
热议问题