Basically a web app that we distribute to clients, one of whom will be trialling it so I need to be able to switch it off at a certain point. Don’t want to put the end date in the web.config in case they work out they can change it, I was thinking of putting something in the global.asax with a hard coded date, but then I’m not sure how I can ‘turn off’ the app. I was thinking of checking the date in the Authenticate Request part and simply redirecting to a page that says your trial is finished (or something similar), but is there a better way?
Share
You can do that on
global.asaxas:this is safer than place it on web.config, but nothing is safe enough. Its even better there to redirect them to a page, or not show them a message, or what ever you think.
For make redirect to a page you also need to check if the call if for a page, and the code will be as:
To makes it even harder, you can make a custom BasePage that all page come from it (and not from
System.Web.UI.Page) and you place there the limit on the render of the page – or show a message on top of every page render, that the time is ends.