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 6566845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:15:53+00:00 2026-05-25T14:15:53+00:00

I have a tilde path. I would like to convert it into client url

  • 0

I have a tilde path. I would like to convert it into client url

    var path = "~/Presentation/Resources/Images/masterPage/cleanup.png";
    var a =  '<%=Page.ResolveClientUrl(" '+path+' ") %>';

    var b = '<%=ResolveUrl("~/Presentation/Resources/Images/masterPage/cleanup.png") %>';

alert("var a-->"+a);
alert("var b-->"+b);

although the code above seems the same, the results I obtain for var a and var b are very different.

Result

var a --> ~/Presentation/Resources/Images/masterPage/cleanup.png
var b --> ../../Resources/Images/masterPage/cleanup.png

I have a variable that stores the path, but I failed to get the result exactly like var b.
What can I do for var a so that I can get the result like var b?

  • 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-25T14:15:54+00:00Added an answer on May 25, 2026 at 2:15 pm

    The methods you are calling, ResolveClientUrl and ResolveUrl, are different. ResolveClientUrl tells you the URL relative to the page you are on; ResolveUrl tells you the URL relative to the site root. You can find a more thorough description at http://www.andornot.com/blog/post/ResolveUrl-vs-ResolveClientUrl.aspx

    There is also more info in this other SO question.

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

Sidebar

Related Questions

I have lots of UTF-8 content that I want inserted into the URL for
We have moved a lot of images and javascript file that was inside class
I have a table with primary keys that look like this: FIRSTKEY~ABC SECONDKEY~DEF FIRSTKEY~DEF
I'm trying to convert a flat file into an Excel-readable format. We receive the
I have split some pages in between subdomains and want to do a URL
I have strings which look like string1 = ~01301~^~DATA1,DATA2 DATA3~^15.87^717^0.85^81.11^2.11^0.06^0 string2 = ~01341~^~DATA3,DATA2 DATA1
I have examples like this in my spec file: it does something, :separate=> true
I am writing an app which would tile the images 256 * 256 and
I am using struts 1.1 with tiles. I have tiles with definitions like <definition
I have an app displaying Japanese characters but for some reason, the tilde (~)

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.