System.Web.Mvc.ReflectedActionDescriptor descriptor = filterContext.ActionDescriptor as 

System.Web.Mvc.ReflectedActionDescriptor;
if (descriptor != null)
{
Type actionType =descriptor.MethodInfo.ReturnType;
if (actionType.Equals(typeof(ActionResult)))
{
if (actionType.IsSubclassOf(typeof(JsonResult)))
{
Response.Write("JsonResult");
}
else if (actionType.IsSubclassOf(typeof(ContentResult)))
{
Response.Write("ContentResult");
}
else
{
Response.Write("ViewResult");
}
}
else
{
if (actionType.Equals(typeof(JsonResult)))
{
Response.Write("JsonResult");
}
else if (actionType.Equals(typeof(ContentResult)))
{
Response.Write("ContentResult");
}
else
{
Response.Write("ViewResult");
}
}
}

  

最新文章

  1. linux c++应用程序内存高或者占用CPU高的解决方案_20161213
  2. [.NET领域驱动设计实战系列]专题四:前期准备之工作单元模式(Unit Of Work)
  3. JSP导入EXCEL样式
  4. CPU绑定操作
  5. DP总结
  6. Log4j2常见使用示例及Syslog/Syslog-ng
  7. 理解 python metaclass使用技巧与应用场景分析
  8. quartz 的job中获取到applicationContext
  9. 修正 phpcmsv9 VIP过期日期为1970
  10. 使用LINQ 對List分頁/區
  11. Jquery Table 的基本操作
  12. word的不同章节之间添加不同的页眉
  13. Android 实现环形进度按钮circular-progress-button
  14. 生产环境-jvm内存溢出-jprofile问题排查
  15. Win10个性化设置
  16. 全方位解读"CPU load average"
  17. JavaScript设计模式--简单工厂模式例子---XHR工厂
  18. Akka(31): Http:High-Level-Api,Route rejection handling
  19. SpringBoot学习笔记
  20. Windows server 1709(不含UI)模板部署

热门文章

  1. Metasploit Framework(8)后渗透测试(一)
  2. js代码跑马灯效果-----轮播图字效果!
  3. python学习笔记01-变量
  4. python基础-分支判断语句(4)
  5. mysql 开发进阶篇系列 16 MySQL Server(myisam key_buffer)
  6. 【原】使用vue2+vue-router+vuex写一个cnode的脚手架
  7. Java——代码块
  8. man statd(rpc.statd中文手册)
  9. Perl的列表和数组
  10. 移植 Qt 至 tiny210 详细过程