Skip to content

Instantly share code, notes, and snippets.

@josy1024
Last active May 18, 2018 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josy1024/98804703de492154adbabc123a4e9b2f to your computer and use it in GitHub Desktop.
Save josy1024/98804703de492154adbabc123a4e9b2f to your computer and use it in GitHub Desktop.
redirect to otherurl aspx
<%@ Page Language="C#" %>
<script runat="server">
protected override void OnLoad(EventArgs e)
{
Response.Redirect("/pathnew/otherurl.aspx");
//maybe useful as default.aspx for folder redirections
// variant and redirect with "q" parameter
// Response.Redirect("/pathnew/otherurl.aspx?q=" + Server.HtmlEncode(Request.QueryString["q"]) );
}
</script>
@josy1024
Copy link
Author

Last update: + add QueryString option

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment