最近一段时间做了个ASP.NET MVC4.0的项目,项目马上就要结束了,今天忙里偷闲简单总结一下心得:

1. 如果Action需要有返回值的话,必须是ActionResult的话,可以返回一个EmptyResult,Demo实例如下:

/// <summary>
/// 
/// </summary>
/// <returns>EmptyResult</returns>
public ActionResult EmptyActionResult()
{
    Response.Write("This is a string content");
    return new EmptyResult();
}
View Code

相关文章:

  • 2022-12-23
  • 2021-07-06
  • 2021-09-08
  • 2021-06-24
  • 2019-10-25
  • 2021-08-17
  • 2021-06-19
猜你喜欢
  • 2021-12-12
  • 2022-01-03
  • 2021-11-03
  • 2021-12-24
  • 2022-12-23
  • 2021-10-16
  • 2022-12-23
相关资源
相似解决方案