How can i stop asp.net website?
I want check some condition and after that if something's wrong then stop website from loading.
Asked
Active
Viewed 6,926 times
5

slugster
- 49,403
- 14
- 95
- 145
-
What exactly do you want to check? – slugster Feb 15 '11 at 07:30
-
What do you mean by stop website from loading? – Anuraj Feb 15 '11 at 07:30
-
@Anuraj : stop website from loading = nothing happend? is this possible? or i should do somthing else – Feb 15 '11 at 07:31
-
You want to stop the execution of Page_Load event? What you are trying to achieve? – Anuraj Feb 15 '11 at 07:33
-
@Anuraj : stop the execution of application_Start!! again if it this possible. – Feb 15 '11 at 07:35
-
@Raika: Check this SO link : http://stackoverflow.com/questions/380043/stop-execution-of-asp-net-application – Anuraj Feb 15 '11 at 07:38
-
Maybe if you have a login screen, you can check for your condition and disable the login activity! – V4Vendetta Feb 15 '11 at 07:40
-
so it's impossbile. i neeed Redirect to some page. – Feb 15 '11 at 07:42
2 Answers
5
You could try the code.
Response.End()

Shankar Narayana Damodaran
- 68,075
- 43
- 96
- 126
-
but isn't it going to cause a "Thread was being aborted." exception in that case? – curiousBoy Mar 26 '17 at 17:55