How to serve html file from another directory as ActionResult

前端 未结 6 1630
长发绾君心
长发绾君心 2020-12-05 13:38

I have a specialised case where I wish to serve a straight html file from a Controller Action.

I want to serve it from a different folder other than the Views folder

6条回答
  •  孤城傲影
    2020-12-05 14:07

    Check this out :

        public ActionResult Index()
        {
            return new FilePathResult("~/Html/index.htm", "text/html");
        }
    

提交回复
热议问题