I am running a timer and performing a redirect after a user changes his or her password (AKA, notify them that the password was changed and then send them back to the home page). However, I can’t seem to do a relative path in the code below. Listed below is what I’d like to do:
Response.AddHeader("REFRESH", "2;URL="~/pages/home.aspx");
Why isn’t this working? How do I get it to work? (I know I can do relative paths in other parts of the site, but that is because it is running server side.) Thanks.
You need to specify an absolute URL for the REFRESH header. Take a look at this post showing how to obtain an absolute URL from relative (you could use the
ResolveServerUrlshown there):For reference: