编译时,我遇到了这个错误:The name 'View' does not exist in the current context
,这是关于我的代码 return View();
的引用。
完整的示例代码:
namespace Controllers
{
public class FilePageController
{
//
// GET: /FilePage/
public ActionResult Index()
{
return View();
}
}
}
我做过几次这样的事情,在SO上找不到答案,所以我想发帖并附上答案,以防其他像我一样在学习MVC时也遇到同样的问题。
22:18:01Z
稍微超时了一点,但你还是得到了它。这给我的印象是你已经知道了答案。 - Satpal