c# - MVC Area error on ActionExecutingContext Filter -


I'm getting a non static method , This filter will find some data on the DB and provide it to the controller, through the viewbars of the FiltersContact , this code is:

  Public Override Zero Non-Connection (Action Accepting Contact Filtercontact) {{var db = new units} using {var redirect = MvcApplication.reqContext; Var seos = db.SEO.Where (x => x.id == redirect.seoId). Ollist (); Var desconto = db.QueroDesconto.First (); // Receipt Cookie Banner Home FilterContact. Controller Viewbag BannerHome = FilterContact Hpptx request. Cookies ["Bannerhome"]! = Null? Int.Parse (filterContext.HttpContext.Request.Cookies ["BannerHome"]. Value): 0; FilterContext.Controller.ViewBag.objEstados = Objestos; FilterContext.Controller.ViewBag.Desconto = desconto; Base.OnActionExecuting (filterContext); }}  

The thing is, it only happens when I'm reaching an MVC area and when I'm debugging it never happens

< P>

The problem was in my DB search, where I was getting zero values ​​in my redirect var .

This Var was only populated in my root handler controller in my root project, which every time I ask for a page and when my area was not executing this controller, I always empty Get the value.

Now, only debugging is being done because every time I debug, by default, I will start with the root project and thus a zero value


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -