[Route("home")]
[Route("/")]
public ContentResult Index()
{
//return new ContentResult()
//{
// Content = "<p>Hello from Index</p>",
// ContentType = "text/html"
//};
//如果需要使用Content方法,添加的Controller类需要继承Microsoft.AspNetCore.Mvc.Controller
return Content("<p>Hello from Index</p>","text/html");
}
040 ContentResult
最新推荐文章于 2024-09-14 12:06:52 发布