我可以称为QUOT一个ActionResult;查看" [英] Can I have an ActionResult called "View"

查看:91
本文介绍了我可以称为QUOT一个ActionResult;查看"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

code:

public ActionResult View(string id)
{ 
   return View();
}

我目前得到计算器例外当我这样做。

I currently get stackoverflow exceptions when I do this.

推荐答案

您应该得到一个编译器警告,你的查看口罩定义的基础类和你应该明确地使用关键字。如果您改变code要做到这一点,而不是,它应该工作,只要你愿意:

You should be getting a compiler warning that your definition of View masks that of the base controller class and that you should explicitly use the new keyword. If you change your code to do this instead, it should work as you'd like:

return base.View();

这篇关于我可以称为QUOT一个ActionResult;查看"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆