Response.Redirect

Bucky

Well-known member
Joined
Dec 23, 2001
Messages
791
Location
East Coast
User Rank
*Expert*
If I use Response.Redirect in the Load event of a Page (or in a
method called from the Load event), is the pages HTML ever
returned to the client browser?

For example, if a user does not have permission to view a certain
page, I want to redirect them to a page saying that action was a
"no-no", without them being able to view the page they tried to
in any way.
 
Use Server.Transfer(). I dont believe the client will be sent anything other than headers using Response.Redirect() if ASP.NET buffering is enabled, but to be on the safe side use Server.Transfer(), which stops execution of the page altogether. Ill do some tests to see if data is sent when Response.Redirect() is used.[edit]The more that I think about it, Response.Redirect() should be sending a 304 response code. 304s redirect the browser to a different page. Say for instance if the page location has changed.[/edit]
 
Back
Top