This question is basically to know and justify whether what I am doing is a good practice or if there are any other ways to achieve the solution for the problem.
Here is the problem....
* I have an MVC application with many controllers and action methods. Customers will be accessing different action methods from different sources (google, bing, third party sites) adding a query string signature at the end.
* Since I dont want to check the querystring value in every action of the controller. I created a new controller "BaseController.cs" which inherits from the MVC Controller class. And implements the following code. All the application controllers will inherit from the BaseController.
public class BaseController : Controller
{
public BaseController():base()
{
string siteReference = HttpContext.Request["ref"];
}
}
I am requesting the experts of MVC to suggest better ways. Thanks in advance.
-KK