Here is an example of how to perform a HTTP redirect in C# using ASP.NET:
main.cs
// Redirect to a new pageResponse.Redirect("http://example.com/newpage.aspx");
// Redirect to a new page with a query stringResponse.Redirect("http://example.com/newpage.aspx?id=123");
// Redirect to a local pageResponse.Redirect("~/newpage.aspx");
// Redirect with a permanent HTTP redirect status codeResponse.RedirectPermanent("http://example.com/newpage.aspx");
// Redirect with a temporary HTTP redirect status codeResponse.RedirectTemporary("http://example.com/newpage.aspx");
492 chars
15 lines
Note that these redirects should generally be performed in the Page_Load or Page_Init events of your ASP.NET page.