Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default value of endResponse parameter of Response.Redirect method

Tags:

c#

.net

asp.net

I want to know the default value of endResponse parameter of HttpResponse.Redirect Method (String, Boolean) method

like image 785
Imran Rafique Avatar asked May 22 '15 10:05

Imran Rafique


People also ask

What is response redirect in ASP NET?

Response. Redirect sends an HTTP request to the browser, then the browser sends that request to the web server, then the web server delivers a response to the web browser. For example, suppose you are on the web page "UserRegister. aspx" page and it has a button that redirects you to the "UserDetail.

What is response redirect in VB net?

Redirect(String) Redirects a request to a new URL and specifies the new URL. Redirect(String, Boolean) Redirects a client to a new URL. Specifies the new URL and whether execution of the current page should terminate.


1 Answers

The default value of endResponse parameter of HttpResponse.Redirect is true.

Calling Redirect is equivalent to calling Redirect with the second parameter set to true.

Redirect calls End which throws a ThreadAbortException exception upon completion. This exception has a detrimental effect on Web application performance. Therefore, it is recommended that instead of this overload you use the HttpResponse.Redirect(String, Boolean) overload and pass false for the endResponse parameter, and then call the CompleteRequest method. For more information, see the End method.

See this MSDN link for reference - https://msdn.microsoft.com/en-us/library/t9dwyts4%28v=vs.110%29.aspx

like image 108
Manik Arora Avatar answered Oct 05 '22 10:10

Manik Arora