MVC。Action方法,常用的返回类型有几种?

常用的:

1,string,直接返回响应报文字符串

public ActionResult test()
{
return "哈哈";
}
2.ViewResult,ActionResult--返回视图对象

public ActionResult Test()
{
return View();
}

或者

public ViewResult Test()
{
return View();
}
3.JsonResult--返回json字符串

原文地址:https://www.cnblogs.com/caofangsheng/p/4927649.html