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

  • Home
  • SEARCH
  • 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 390261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:56:50+00:00 2026-05-12T15:56:50+00:00

I have 2 question How to get absolute Uri in asp.net. For example: Input:

  • 0

I have 2 question

  1. How to get absolute Uri in asp.net.
    For example: Input: “~/Files/” , Output:”www.sampleweb.com/Files/”

  2. What is the “go to root” command in url on the client side like
    server side command “~/Files/”

For example:

File location

myAspProjectName/Files/aa.jpg
myAspProjectName/User/bb.aspx

into the bb.aspx

<asp:image ImageUrl="~/Files/aa.jpg" id="img1" runat="server"/>

this work fine. But

<img src="~/Files/aa.jpg" alt=""/>

don’t work

  • 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-12T15:56:51+00:00Added an answer on May 12, 2026 at 3:56 pm

    Like Mark B says there is no obvious syntactic shortcut for this.

    If you’re doing it with the current request then you can just use Request.Url or for an arbitrary file you can use Page.ResolveURL("~/some/path") if you are using an ASP.Net page. These are methods that will generate absolute relative URIs i.e. those of the form /path/somefile then if you then get the host name using Mark B’s approach you can concatenate the two things together.

    As for (2) I think you possibly mean absolute relative URIs. If a relative URI begins with a forward slash it is resolved as being relative to the base domain e.g. if you were on the page http://yourdomain.com/somedir/somepage.aspx and you followed a link which was /otherdir/somepage.aspx you’d end up at http://yourdomain.com/otherdir/somepage.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Reading this article http://support.microsoft.com/kb/813878 I have a question: Where can I get ipseccmd.exe for
I have a question about JSF and GET http request. How can I get
I have a question regarding how to get a div height. I'm aware of
I have few Question for which I am not able to get a proper
I have a route defined like this: GET /question/:q_id controllers.Questions.viewQuestion(q_id: Long) Then in my
I have a question. How could I get the data from a google search
I have a question about the JFileChooser in Swing. I'm trying to get multiple
I have this question relating to Lucene. I have a form and I get
I have a question concerning Core Data and how, if at all, Entities get
So, i have some question about xml Documents in Java. Can i get all

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.