I have an MVC website and I'm trying to set the page as active in the controller.
The result I'm getting is the ViewBag
is greyed out with an underline. On hover, the message says:
Unreachable code detected
Here is my home controller
My using statements in the controller are:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
You can’t have code after the return statement. That makes it... unreachable.
Move the ViewBag assignment line to before the return View().