c# - Reset value of a method in another controller? -


is there way can change value of isclicked reviewscontroller once logout page has redirected user home.cshtml page in views/home/ ?

i have method in controller called reviews sets isclicked bool true after button clicked when user logged in.

i have method index (views/reviews/index.cshtml) within reviewscontroller resets isclicked value false when unauthenticated user visits page:

// get: reviews public async task<iactionresult> index() {     var results = await _context.reviews.tolistasync();      //check authentication     foreach (reviews reviews in results)     {         if (!user.identity.isauthenticated)         {             reviews.isclicked = false;             _context.update(reviews);             await _context.savechangesasync();         }     }      return view(await _context.reviews.tolistasync()); } 

if user logs out page redirected home.cshtml (views/home/).

however, if user logs in home.cshtml page afterwards clicks on index.cshtml page(views/reviews) value not reset false since have reauthenticated before visiting page unauthenticated user.

a solution redirect action method logout account controller index.cshtml page not want this.

any ideas?


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -