Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

die() or exit() functionality in ASP.NET

Is there any function similar to die() or exit() from PHP in ASP.Net?

like image 320
Kamran Ahmed Avatar asked Oct 03 '13 10:10

Kamran Ahmed


1 Answers

It depends on where you are in your code, but you want a way of getting the Response object.

From here, you can call HttpResponse.End().

This method sends the buffer to the client, raises the EndRequest event and throws a ThreadAbortException to stop the rest of the page executing.

like image 67
Connell Avatar answered Sep 24 '22 14:09

Connell