I'm building a controller that other controllers can inherit (provide base functionality across site without repeating code):
public abstract class ApplicationController : Controller
{
protected ApplicationController()
{
//site logic goes here
//what is the value of agentID from the Action below??
}
}
public class AgentController : ApplicationController
{
public ActionResult Index(string agentID)
{
return View();
}
}
The logic that applies to the entire site will go into the constructor of the ApplicationController class.
The problem is in that constructor I need to access the value in the parameter from the Action, in this case agentID (it will be the same across the entire site). Is there a way to read that value in?