Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Experts*
Posted

If I use Response.Redirect in the Load event of a Page (or in a

method called from the Load event), is the page's 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.

"Being grown up isn't half as fun as growing up

These are the best days of our lives"

-The Ataris, In This Diary

  • *Gurus*
Posted
Use Server.Transfer(). I don't 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. I'll 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. 304's redirect the browser to a different page. Say for instance if the page location has changed.[/edit]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...