Wednesday, June 16, 2004

VJs Tip Of The Day - June 16th 2004

Our Simple Response.Redirect method

Whenever Response.Redirect line is executed the browser gets a HTTP staus code of 302 from the server indicating it to GET/POST again to the new URL provided... This means that the page does one more round trip to the server with different URL... Most of the browser use GET request to comply with HTTP standards and if they use POST then they would have to prompt the user for permission... In anycase there is a performance hit of posting twice... Most of the cases it is not visible to the user...

If you are very high on performance then use Server.Transfer instead... Also note that your form variables are not available in the next page in case of Response.Redirect; in case of Server.Transfer the data submitted by the user is preserved...

Well I think this is long enough for a tip, so rest of the info I will include in a small article...

No comments: