Hello,
I am attempting to Get the current controller and action being called in the route. In my Global.asax.cs I have the following using and the following line:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using IProwlAdminUI.Models;
*** LINE WITH ISSUE***
string action = ViewContext.RouteData.Values["controller"].ToString() + ViewContext.RouteData.Values["action"].ToString()
*******
Right now the ViewContext.RouteData is giving me "an object reference is required for the non-static field, method, or property 'System.Web.Mvc.ControllerContext.RouteData.Get'"
I need to get this so that I can use the controller and action to evaluate permissions for the user and see if they can perform the action they are attempting to do.
Any Help on this would be greatly appreciated.
Thanks