Monday, July 29, 2013

URL Redirection

Two common methods I use for programatically redifrecting the user (in C#) are as follows.

Instant Redirection:
Response.Redirect("http://google.com");
Response.Redirect("http://google.com", false);
The second parameter is EndResponse and indicates whether execution of the current page should terminate.

Delayed Redirection:
Response.AddHeader("REFRESH", "5;URL=http://google.com");

No comments:

Post a Comment