I want to add some data for particular controller’s all views.
the web-apps i have already have something who run first when a request come to server. if i make another something like
protected override void Initialize(System.Web.Routing.RequestContext requestContext)
{
AddMemberLogin(); //Add the Member if he is logged in
AddApprovalModeToViewData();
ViewData["call3"] = //called func;
ViewData["call2"] = //called func;
ViewData["call1"] = //called func;
}
if i make this in the controller that i found that they not run the function who already implemnted.
are their any way to run both function but this when request come to this controller i want
You could use an action filter:
And then decorate your controller with this attribute: