Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 663689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:31:02+00:00 2026-05-13T23:31:02+00:00

I am running a timer and performing a redirect after a user changes his

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:31:03+00:00Added an answer on May 13, 2026 at 11:31 pm

    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 ResolveServerUrl shown there):

    Response.AddHeader("REFRESH", "2;url=" + ResolveServerUrl("~/pages/home.aspx"));
    

    For reference:

    /// <summary>
    /// This method returns a fully qualified absolute server Url which includes
    /// the protocol, server, port in addition to the server relative Url.
    /// 
    /// Works like Control.ResolveUrl including support for ~ syntax
    /// but returns an absolute URL.
    /// </summary>
    /// <param name="ServerUrl">Any Url, either App relative or fully qualified</param>
    /// <param name="forceHttps">if true forces the url to use https</param>
    /// <returns></returns>
    public static string ResolveServerUrl(string serverUrl, bool forceHttps)
    {
        // *** Is it already an absolute Url?
        if (serverUrl.IndexOf("://") > -1)
            return serverUrl;
    
        // *** Start by fixing up the Url an Application relative Url
        string newUrl = ResolveUrl(serverUrl);
    
        Uri originalUri = HttpContext.Current.Request.Url;
        newUrl = (forceHttps ? "https" : originalUri.Scheme) + 
                 "://" + originalUri.Authority + newUrl;
    
        return newUrl;
    } 
    
    /// <summary>
    /// This method returns a fully qualified absolute server Url which includes
    /// the protocol, server, port in addition to the server relative Url.
    /// 
    /// It work like Page.ResolveUrl, but adds these to the beginning.
    /// This method is useful for generating Urls for AJAX methods
    /// </summary>
    /// <param name="ServerUrl">Any Url, either App relative or fully qualified</param>
    /// <returns></returns>
    public static string ResolveServerUrl(string serverUrl)
    {
        return ResolveServerUrl(serverUrl, false);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a repeating timer that runs down a clock. During the clock running
Can anyone post a sample code wherein theres a running timer(javascript settimeout) and doing
How to find the currently running SharePoint 2007 Timer jobs using STSADM?
How can I run a process while a timer is running in the program.
I have a Java program performing some large analysis tasks, running through a loop
How would I implement a system that will keep 20 applications running on a
I'm running this loop on the server side: while (true) { $changed = $this->sockets;
I've got an application (that is targetting .Net Framework 2.0) that is running on
It seems that when performing an & operation between two long s it takes
I have a long running insert transaction that inserts data into several related tables.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.