In my application I would like to something like this
if(settings = null) {
// redirect the request to example.com/setup
}
I have tried to use webactivator for this but it seems it’s to early to to a redirect the request.
Another way is to have a base controller and check every request but that seems like a bad idea.
So, can anyone recommend a solution?
I needed to do the same thing for my opensource project WeBlog. I ended up using a custom controller factory. If the site is not configured, I redirect to the Setup controller by using the following code:
To register your custom controller factory, just add this line to the application_start method in the global.asax: