0

Possible Duplicate:
Load Razor view from db, but ViewBag is broken

I have an MVC3 application. I have added numerous views to it. I added another view. Tried to view it in a browser and i get this error:

CS0103: The name 'ViewBag' does not exist in the current context

I'm using ViewBag throughout my app. This is the razor view code:

   @{
       ViewBag.Title = "Index";
    }

   <h2>Index</h2>

This is my controller code:

    public ActionResult Index()
    {
        ViewBag.Title = "Order Details Page";
        return View();
    }

What extremely simple step am i missing? Thanks

Community
  • 1
  • 1
BoundForGlory
  • 4,114
  • 15
  • 54
  • 81

0 Answers0