locked
how to set a cookie and based on that cookie, always redirect to the same page if any link is clicked using c# MVC RRS feed

  • Question

  • User221424154 posted

    how to set a cookie and based on that cookie, always redirect to the same page if any link is clicked using c# MVC

    I'm using MVC and typescript

    Wednesday, May 6, 2020 8:24 AM

All replies

  • User753101303 posted

    Hi,

    MVC 5 or ASP.NET Core? It could be done from multiple places such as by using  https://docs.microsoft.com/en-us/aspnet/mvc/overview/older-versions/hands-on-labs/aspnet-mvc-4-custom-action-filters or an Owin, ASP.NET Core middleware. Or any link included links you may have on your page to external sites ??? (you are talking about C# and then  Typescript).

    As often a brief understanding of the exact purpose could help to better figure out where it would make more sense to handle that. This is to block a user from using your site until a given date/time to allow for a maintenance operation ???

    Wednesday, May 6, 2020 8:50 AM