Response.Redirect

What is the difference between a call Response.Redirectfrom the code line of a page and a call HttpContext.Current.Response.Redirectfrom a common method in another class?

When I call HttpContext.Current.Response.Redirect, it sometimes causes a 404 error when the call is Page.Respsone.Redirectnot made.

EDIT:

Oh my mistake, it was a typo.

+3
source share
2 answers

There is no difference between the two methods (getter for Page.Requestjust returns a link to HttpContext.Current.Request- you need to dig a bit into the Reflector, but there) - HTTP404which you see as a result is a response from the server and completely depends on the value passed to the method Redirect.

+9
source

404, URL . , , .

+2

Source: https://habr.com/ru/post/1710340/


All Articles