When / where is the earliest point in WebForm to call Response.Redirect?

I've always made calls to Response.Redirect in my OnLoad method in the WebForm, mainly because every example I've seen has done this. I was wondering if it was more efficient (and correct) to do this in OnPreInit? Even if endResponse is true?

0


source to share


1 answer


Obviously, the sooner the better. Don't make your server run any longer than it needs to before redirecting to a page of interest.

However, you don't always know what you want to redirect before the page load event, or even later - perhaps after handling the button click event.



+1


source







All Articles