akshat goel

akshat goel

  • NA
  • 35
  • 7.4k

use new keyword if hiding was intended error in mvc4

Apr 13 2014 5:18 PM
I have the following code in mvc 4

        public ActionResult Profile()
        {
            var cookie = Request.Cookies["RememberUsername"];
            var uname = cookie;
            
            ViewBag.uname = uname;
            
            return View();
        }


The compiler is showing the following error:
Warning1'MvcApplication16.Controllers.sellerController.Profile()' hides inherited member 'System.Web.Mvc.Controller.Profile'. Use the new keyword if hiding was intended.c:\users\lenovo\documents\visual studio 2012\Projects\MvcApplication16\Controllers\sellerController.cs2029MvcApplication16


Answers (1)