Which the best method to use in navigating through web application pages

Donald Symmons 2,206 Reputation points

Hello Forum,

Please I will like to know if there is any special advantage in any of these page navigation links?

For the .aspx pages I have these:

  1. https://myaddress.com/dashboard
  2. /dashboard
  3. dashboard

In the serverside window:

  1. Response.Redirect("https://myaddress.com/dashboard");
  2. Response.Redirect("/dashboard");
  3. Response.Redirect("dashboard");

Please is there any that is best preferred, because I have seen different people use different redirect codes to navigate web pages.

I asked this because I will like to know if there is any security advantage to using a particular redirect code.

Microsoft Technologies based on the .NET software framework.
2,303 questions
A set of technologies in the .NET Framework for building web applications and XML web services.
1,716 questions
ASP.NET Web Forms
ASP.NET Web Forms
A part of the ASP.NET web application framework that can be used to create ASP.NET web applications.
652 questions
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,452 questions
0 comments No comments
{count} votes

Accepted answer
  1. QiYou-MSFT 4,151 Reputation points Microsoft Vendor

    Hi @Donald Symmons

    Absolute URL: https://myaddress.com/dashboard

    Relative URL: /dashboard, dashboard

    Some browsers may reject the relative URL.

    For mobile pages only, if your application relies on cookieless sessions, or might receive requests from mobile devices that require cookieless sessions, using a tilde (~) in a path can result in creating a new session and potentially losing session data. To set a property on a mobile control with a path such as "~/path", resolve the path using ResolveUrl "~/path" before assigning it to the property.

    Generally speaking, Absolute URL is more stable. It is not affected by other factors.

    When you change the name of a folder or project or other actions to change the file path, Relative URL will be affected.

    Best regards,
    Qi You

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

0 additional answers

Sort by: Most helpful