View Full Version : Request.ApplicationPath
bruce
03-31-2003, 01:58 AM
Try this
src='/Graphics/whatever.gif'
[b]quote:Originally posted by MSolve1
My problem actually is that whenever I'm in a page
inside a subdirectory, like this one:
http://whatever.web101.discountasp.net/Admin/whateverpage.aspx
I cant access the graphics in this subdirectory:
http://whatever.web101.discountasp.net/Graphics/
because Request.ApplicationPath always return a '/'
instead of 'http://whatever.web101.discountasp.net/'
I wish I could just use this from whateverpage.aspx:
src='../Graphics/whatever.gif'
but it won't allow me to do that.
Any ideas?
Thanks,
MSolve1
[b]quote:Originally posted by bruce
The FTP path is different from the HTTP path
Http://www.finsoftware.com
=
ftp://ftp.finsoftware.com/finsoftware
For your application, Request.ApplicationPath will return /
[b]quote:Originally posted by MSolve1
Hi, Guys
I uploaded our ASP.NET project using Frontpage Extensions into the temporary URL provided on the server. However, everytime the pages
make a call to 'Request.ApplicationPath', it always return the root path (i.e. "/").
Here's how it is setup when viewed from an FTP program (I'm aware that it's not recommended to use an FTP program side by side with Front Page Ext. but I'm using it anyway, just to view the directory structure):
/finsoftware
[graphics]
...
default.aspx
...
global.asax
web.config
Example:
src="<%=Request.ApplicationPath %>/graphics/banner_fsslogo.gif"
Is there a special setting somewhere in the application or the
Web server that I should change in order to make the call in the above example point to '/finsoftware' directory?
Thanks,
MSolve1
</blockquote id="quote"></font id="quote">
</blockquote id="quote"></font id="quote">
</blockquote id="quote"></font id="quote">
MSolve1
03-31-2003, 08:55 AM
Hi, Guys
I uploaded our ASP.NET project using Frontpage Extensions into the temporary URL provided on the server. However, everytime the pages
make a call to 'Request.ApplicationPath', it always return the root path (i.e. "/").
Here's how it is setup when viewed from an FTP program (I'm aware that it's not recommended to use an FTP program side by side with Front Page Ext. but I'm using it anyway, just to view the directory structure):
/finsoftware
[graphics]
...
default.aspx
...
global.asax
web.config
Example:
src="<%=Request.ApplicationPath %>/graphics/banner_fsslogo.gif"
Is there a special setting somewhere in the application or the
Web server that I should change in order to make the call in the above example point to '/finsoftware' directory?
Thanks,
MSolve1
bruce
03-31-2003, 11:15 AM
The FTP path is different from the HTTP path
Http://www.finsoftware.com
=
ftp://ftp.finsoftware.com/finsoftware
For your application, Request.ApplicationPath will return /
[b]quote:Originally posted by MSolve1
Hi, Guys
I uploaded our ASP.NET project using Frontpage Extensions into the temporary URL provided on the server. However, everytime the pages
make a call to 'Request.ApplicationPath', it always return the root path (i.e. "/").
Here's how it is setup when viewed from an FTP program (I'm aware that it's not recommended to use an FTP program side by side with Front Page Ext. but I'm using it anyway, just to view the directory structure):
/finsoftware
[graphics]
...
default.aspx
...
global.asax
web.config
Example:
src="<%=Request.ApplicationPath %>/graphics/banner_fsslogo.gif"
Is there a special setting somewhere in the application or the
Web server that I should change in order to make the call in the above example point to '/finsoftware' directory?
Thanks,
MSolve1
</blockquote id="quote"></font id="quote">
MSolve1
03-31-2003, 12:03 PM
How would I change it in such a way that it will return
'/finsoftware' instead?
Thanks in advance.
[b]quote:Originally posted by bruce
The FTP path is different from the HTTP path
Http://www.finsoftware.com
=
ftp://ftp.finsoftware.com/finsoftware
For your application, Request.ApplicationPath will return /
[b]quote:Originally posted by MSolve1
Hi, Guys
I uploaded our ASP.NET project using Frontpage Extensions into the temporary URL provided on the server. However, everytime the pages
make a call to 'Request.ApplicationPath', it always return the root path (i.e. "/").
Here's how it is setup when viewed from an FTP program (I'm aware that it's not recommended to use an FTP program side by side with Front Page Ext. but I'm using it anyway, just to view the directory structure):
/finsoftware
[graphics]
...
default.aspx
...
global.asax
web.config
Example:
src="<%=Request.ApplicationPath %>/graphics/banner_fsslogo.gif"
Is there a special setting somewhere in the application or the
Web server that I should change in order to make the call in the above example point to '/finsoftware' directory?
Thanks,
MSolve1
</blockquote id="quote"></font id="quote">
</blockquote id="quote"></font id="quote">
MSolve1
03-31-2003, 12:48 PM
My problem actually is that whenever I'm in a page
inside a subdirectory, like this one:
http://whatever.web101.discountasp.net/Admin/whateverpage.aspx
I cant access the graphics in this subdirectory:
http://whatever.web101.discountasp.net/Graphics/
because Request.ApplicationPath always return a '/'
instead of 'http://whatever.web101.discountasp.net/'
I wish I could just use this from whateverpage.aspx:
src='../Graphics/whatever.gif'
but it won't allow me to do that.
Any ideas?
Thanks,
MSolve1
[b]quote:Originally posted by bruce
The FTP path is different from the HTTP path
Http://www.finsoftware.com
=
ftp://ftp.finsoftware.com/finsoftware
For your application, Request.ApplicationPath will return /
[b]quote:Originally posted by MSolve1
Hi, Guys
I uploaded our ASP.NET project using Frontpage Extensions into the temporary URL provided on the server. However, everytime the pages
make a call to 'Request.ApplicationPath', it always return the root path (i.e. "/").
Here's how it is setup when viewed from an FTP program (I'm aware that it's not recommended to use an FTP program side by side with Front Page Ext. but I'm using it anyway, just to view the directory structure):
/finsoftware
[graphics]
...
default.aspx
...
global.asax
web.config
Example:
src="<%=Request.ApplicationPath %>/graphics/banner_fsslogo.gif"
Is there a special setting somewhere in the application or the
Web server that I should change in order to make the call in the above example point to '/finsoftware' directory?
Thanks,
MSolve1
</blockquote id="quote"></font id="quote">
</blockquote id="quote"></font id="quote">
infojam
05-29-2003, 12:02 AM
Try this in the global.asax Application_BeginRequest event:
'****************************************GLF
'When you install the modules they are set to run in a virtual directory.
'If you want to run them in the root of your web application then a few Mods are needed:
If Application("AppPath") = Nothing Then
Dim sAbsUri As String = Request.Url.AbsoluteUri
Dim sRawUrl As String = Request.RawUrl
If Request.ApplicationPath = "/" Then
Application("AppPath") = Left(sAbsUri, Len(sAbsUri) - Len(sRawUrl))
Else
Application("AppPath") = Left(sAbsUri, Len(sAbsUri) - Len(sRawUrl)) & Request.ApplicationPath
End If
End If
'Now replace:
' Request.ApplicationPath
'With
' Application("AppPath")
' this caches to root path
'****************************************GLF
[b]quote:Originally posted by MSolve1
My problem actually is that whenever I'm in a page
inside a subdirectory, like this one:
http://whatever.web101.discountasp.net/Admin/whateverpage.aspx
I cant access the graphics in this subdirectory:
http://whatever.web101.discountasp.net/Graphics/
because Request.ApplicationPath always return a '/'
instead of 'http://whatever.web101.discountasp.net/'
I wish I could just use this from whateverpage.aspx:
src='../Graphics/whatever.gif'
but it won't allow me to do that.
Any ideas?
Thanks,
MSolve1
[b]quote:Originally posted by bruce
The FTP path is different from the HTTP path
Http://www.finsoftware.com
=
ftp://ftp.finsoftware.com/finsoftware
For your application, Request.ApplicationPath will return /
[b]quote:Originally posted by MSolve1
Hi, Guys
I uploaded our ASP.NET project using Frontpage Extensions into the temporary URL provided on the server. However, everytime the pages
make a call to 'Request.ApplicationPath', it always return the root path (i.e. "/").
Here's how it is setup when viewed from an FTP program (I'm aware that it's not recommended to use an FTP program side by side with Front Page Ext. but I'm using it anyway, just to view the directory structure):
/finsoftware
[graphics]
...
default.aspx
...
global.asax
web.config
Example:
src="<%=Request.ApplicationPath %>/graphics/banner_fsslogo.gif"
Is there a special setting somewhere in the application or the
Web server that I should change in order to make the call in the above example point to '/finsoftware' directory?
Thanks,
MSolve1
</blockquote id="quote"></font id="quote">
</blockquote id="quote"></font id="quote">
</blockquote id="quote"></font id="quote">
[/quote]
infojam
05-29-2003, 11:53 AM
[b]quote:Originally posted by bruce
Try this
src='/Graphics/whatever.gif'
[b]quote:Originally posted by MSolve1
My problem actually is that whenever I'm in a page
inside a subdirectory, like this one:
http://whatever.web101.discountasp.net/Admin/whateverpage.aspx
I cant access the graphics in this subdirectory:
http://whatever.web101.discountasp.net/Graphics/
because Request.ApplicationPath always return a '/'
instead of 'http://whatever.web101.discountasp.net/'
I wish I could just use this from whateverpage.aspx:
src='../Graphics/whatever.gif'
but it won't allow me to do that.
Any ideas?
Thanks,
MSolve1
[b]quote:Originally posted by bruce
The FTP path is different from the HTTP path
Http://www.finsoftware.com
=
ftp://ftp.finsoftware.com/finsoftware
For your application, Request.ApplicationPath will return /
[b]quote:Originally posted by MSolve1
Hi, Guys
I uploaded our ASP.NET project using Frontpage Extensions into the temporary URL provided on the server. However, everytime the pages
make a call to 'Request.ApplicationPath', it always return the root path (i.e. "/").
Here's how it is setup when viewed from an FTP program (I'm aware that it's not recommended to use an FTP program side by side with Front Page Ext. but I'm using it anyway, just to view the directory structure):
/finsoftware
[graphics]
...
default.aspx
...
global.asax
web.config
Example:
src="<%=Request.ApplicationPath %>/graphics/banner_fsslogo.gif"
Is there a special setting somewhere in the application or the
Web server that I should change in order to make the call in the above example point to '/finsoftware' directory?
Thanks,
MSolve1
</blockquote id="quote"></font id="quote">
</blockquote id="quote"></font id="quote">
</blockquote id="quote"></font id="quote">
</blockquote id="quote"></font id="quote">
prankernet0
06-27-2003, 12:31 AM
not entirely sure if this is correct, but as I remember in standard HTML
when an SRC value begins with "/" it automatically points to the root directory.
The most likely SRC values would be:
/graphics/whatever.gif
or http://www.domain.com/graphics/whatever.gif
ScHiZo
-------------------------------
"Hi Bob". "Who's Bob?".[?]
seppey
07-02-2003, 02:12 AM
In your code Infojam, this is commented out at the end...
'Now replace:
' Request.ApplicationPath
'With
' Application("AppPath")
' this caches to root path
Does this mean you ahve to replace ALL instances of Request.ApplicationPath with Application("AppPath") throughout the site?
In mine there are 76 instances of it, most of it in the code-behind.
Before I change and compile, I just wanted to make sure.
Thanks
vBulletin® ©Jelsoft Enterprises Ltd.