Questions tagged [resolveurl]

45 questions
68
votes
3 answers

ResolveUrl without an ASP.NET Page

I am looking for a way to resolve a relative url the way you would with a page or control instance (MSDN Docs) such as: Page.ResolveUrl("~/common/Error.aspx"); ...but when I only have an HttpContext available to me, such as when I am in a…
cweston
  • 11,297
  • 19
  • 82
  • 107
35
votes
3 answers

ASP.Net: Using System.Web.UI.Control.ResolveUrl() in a shared/static function

What is the best way to use ResolveUrl() in a Shared/static function in Asp.Net? My current solution for VB.Net is: Dim x As New System.Web.UI.Control x.ResolveUrl("~/someUrl") Or C#: System.Web.UI.Control x = new…
travis
  • 35,751
  • 21
  • 71
  • 94
28
votes
7 answers

PHP: How to resolve a relative url

I need a function that given a relative URL and a base returns an absolute URL. I've searched and found many functions that do it different ways. resolve("../abc.png", "http://example.com/path/thing?foo=bar") # returns http://example.com/abc.png Is…
Paul Tarjan
  • 48,968
  • 59
  • 172
  • 213
16
votes
6 answers

How can I resolve ASP.NET "~" app paths to the website root without a Control being present?

I want to Resolve "~/whatever" from inside non-Page contexts such as Global.asax (HttpApplication), HttpModule, HttpHandler, etc. but can only find such Resolution methods specific to Controls (and Page). I think the app should have enough knowledge…
John K
  • 28,441
  • 31
  • 139
  • 229
7
votes
2 answers

Absolute file path to relative URL

I've seen lots of tutorials on resolving a relative url to an absolute path, but i want to do the opposite: resolve an system absolute filepath into a relative url. Is there a nice hack-free way to turn a filepath like…
maxp
  • 24,209
  • 39
  • 123
  • 201
5
votes
1 answer

ASP.NET: How to get the virtual path of a file from a generic handler?

How can i resolve a virtual path to a file into a path, suitable for the browser, from within a generic .ashx handler? e.g. i want to convert: ~/asp/ClockState.aspx into /NextAllowed/asp/ClockState.aspx If i were a WebForm Page, i could call…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
5
votes
1 answer

Delphi XE2 - How to get IP of a specified website?

I have a program in which checks a php file on a web server to see if the user is verified. The php files runs through the DB and checks and echos "verified" if they are. Now, people are now easily bypassing the verification system by installing…
Josh Line
  • 625
  • 3
  • 13
  • 27
3
votes
4 answers

hyperlink.NavigateUrl getting changed on master page (possibly by ResolveUrl() )

I have a hyperlink that in certain cases I want to change to show a jquery popup, but I'm having a strange problem when doing it on a master page. The following works in a regular page: hyp1.NavigateUrl = "#notificationPopup"; Which renders as:
Colm Larkin
  • 73
  • 1
  • 5
3
votes
1 answer

How to subscribe to changes on resolved route data - Angular 2

I have a component that resolves data from a route when loaded. My challenge is, whenever the data being rendered by the component changes, the component doesn't get updated unless I refresh the page, or switch to another route and back. I…
mfalade
  • 1,647
  • 2
  • 17
  • 16
3
votes
3 answers

ResolveUrl in Static WebMethod

How do you resolve a url like "../../images/test.png" to "http://yoursite.com/images/test.png" in a static asp.net web method?
Daniel Brink
  • 2,434
  • 4
  • 24
  • 26
3
votes
2 answers

Apache local configuration to resolve files correctly

I have just configured Apache and PHP to work on my local Mac OS X computer. Now PHP works fine, except when I try to load the files for my live sites. The live sites have separate directories and are sorted by client name etc. I've created…
Alex E.
  • 31
  • 1
  • 1
  • 2
2
votes
2 answers

Equivalent of asp.net's ResolveUrl in php

In my apache www dir, I have subdirectory for different personal projects I work on. Ex: www/webApp1 www/webApp2 I access to webApp2 by http://localhost:81/webApp2 (I currently run a portable wamp, that's why I'm on port 81. It does not matter right…
Johnny5
  • 6,664
  • 3
  • 45
  • 78
2
votes
3 answers

Global solution for ResolveUrl XSS issue

We recently has a security scan done, and it turns out our application is susceptible to XSS via the ResolveUrl cookieless state problem described here. Now I am looking for a way to properly fix the issue in a global way for our application. Not…
PaulVrugt
  • 1,682
  • 2
  • 17
  • 40
2
votes
1 answer

Webpack resolve-url-loader resolving incorrect paths

I'm making use of the resolve-url-loader which is working great for importing third party stylesheets that are in turn linking to their own assets. However, i'm struggling to understand how in the instance below my reference to owl.jpg from app.scss…
Samuel
  • 2,485
  • 5
  • 30
  • 40
2
votes
1 answer

ResolveUrl not working in master page in asp.net

Ok, I have some code and sanapshot to explain my problem, I have a master page Main.Master in which I have includes all the references of css and jquery as <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Main.master.cs"…
Usf Noor
  • 219
  • 1
  • 5
  • 21
1
2 3