MVC - How to fix error - The type or namespace name 'Controller' could not be found

preview_player
Показать описание
by adding the following using
using System.Web.Mvc;
you can fix the following errors:
-The type or namespace name 'Controller' could not be found (are you missing a using directive or an assembly reference?)
-The type or namespace name 'ActionResult' could not be found (are you missing a using directive or an assembly reference?)
-The type or namespace name 'HttpPostAttribute' could not be found (are you missing a using directive or an assembly reference?)
-The type or namespace name 'HttpPost' could not be found (are you missing a using directive or an assembly reference?)
-The type or namespace name 'ValidateAntiForgeryTokenAttribute' could not be found (are you missing a using directive or an assembly reference?)
-The type or namespace name 'ValidateAntiForgeryToken' could not be found (are you missing a using directive or an assembly reference?)
Рекомендации по теме
Комментарии
Автор

Hi, I'm still getting the error, even i have using System.Web.Mvc . please let me know why the error is occuring and how can i fix that.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MVCDemo.Controllers
{
public class HomeController : Controller
{
//
// GET: /Home/

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

}
}

vijaykrishna