In my Application_Start() method, how can I stop the execution of the ASP.NET application when certain conditions are not met?
Throwing an exception doesn’t appear to work.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
i don’t think that’s possible; even if you could ‘abort’ the startup, the next attempt to access a URL from the site would try to start it again
perhaps a static variable could be used to signal go/no-go, and begin_request could redirect to a placeholder page instead?