Page.ResolveClientUrl and invalid paths

 For some reason, when I tried to do:

Page.ResolveClientUrl("~/errorpage.aspx?Page=" + url);

I got the error that this was an invalid virtual path, even though it wasn't.  It seemed like the error was with the url because it may have been formatted like "httP://localhost/default.aspx" and that could have caused the error.  So the test was to pull the url outside the method like:

Page.ResolveClientUrl("~/errorpage.aspx") + "?Page=" + url;

And this solved the problem greatly.

Published Wednesday, April 01, 2009 10:52 PM by bmains
Filed under:

Comments

No Comments