1

I've tried just about every relative path that I can think of, and none of them work.

Server.Transfer("/contact-us.aspx");
Server.Transfer("./contact-us.aspx");
Server.Transfer("~/contact-us.aspx");
Server.Transfer("contact-us.aspx");

I'm pretty sure this has to do with the fact that I'm inside of an ascx UserControl. I always get "The file (my file) does not exist."

EDIT:

Also, contact-us.aspx is not a physical file. I'm using Sitecore, and this is a virtual path within the application, and the application knows how to resolve the URL.

1 Answers1

1

The syntax is correct so there's likely to be a problem with the HTTPHandler / URL redirection in the SiteCore engine.

Try using Response.Redirect instead and use the overloaded version to cease all further page processing;

Response.Redirect("~/contact-us.aspx", true);
Brian Scott
  • 9,221
  • 6
  • 47
  • 68
  • I need to pass data to the redirected page without it being in the query string, which is why I was using Server.Transfer. –  Mar 23 '11 at 16:56
  • It turns out this is an issue with Sitecore. It is not possible to use Server.Transfer per their forums. –  Mar 23 '11 at 17:00
  • Great, at least you've got it clarified. All the best. – Brian Scott Mar 23 '11 at 17:02