473,395 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Application root

Outside of ~, does anyone have tips on handling directory structure? I'm
considering adding a parameter in web.config called rootDirectory then
tacking it to relative paths as needed.

Any problems with this?

Thanks,
Brian
Feb 27 '06 #1
3 998
Why do you not want to use ~ ?
"Brian" <br***@nospam.com> wrote in message
news:7H****************@tornado.socal.rr.com...
Outside of ~, does anyone have tips on handling directory structure? I'm
considering adding a parameter in web.config called rootDirectory then
tacking it to relative paths as needed.

Any problems with this?

Thanks,
Brian

Feb 28 '06 #2
Well, I'm not quite sure. I don't understand the entire virtual path thing.
But from what I understand, ~ works in preprocessing but not in html. So
css, images, etc are left broken.

The immediate concern is to address the VS 2005 developer server. It runs
the project not from / but from /$(project)/ The project name must be
inserted into every URL. There are workarounds. One suggestion on the net
invoked the developer server executable with arguments to run the project as
the root url. IIS is always a choice. But I'd rather handle it in the
developer server.

Another concern is the portability of the site should it move to a new
location.

"Arthur Dent" <hi*********************@yahoo.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Why do you not want to use ~ ?
"Brian" <br***@nospam.com> wrote in message
news:7H****************@tornado.socal.rr.com...
Outside of ~, does anyone have tips on handling directory structure? I'm
considering adding a parameter in web.config called rootDirectory then
tacking it to relative paths as needed.

Any problems with this?

Thanks,
Brian


Feb 28 '06 #3
Well, in my experience the ~ resolves exactly like you need, to / (if your
project is the default site) or to /yourProjectName/ (if it is a
sub-directory).
This is a runtime resolution, so if you move the site, it will still work. I
HAVE seen some weird things with rendering of ~ in FireFox in (forexample)
the NavigateUrl
property of the HyperLink control (why, i dont know, never bothered to debug
for firefox). That was 2003 though, havent tried to recreate in 2005.

For html elements such as images, it is actually pretty easy to work
around.... you could do one of two things....
write your image as either of the following:
<asp:image id=myImage runat=server imageurl="~/images/myImage.gif" />
or
<img src='<%= ResolveUrl("~/images/myImage.gif") %>' />

As a result of the ASP/FireFox rendering bug above, i have some code which
dynamically generates the full url for the approot
(essentially the same idea as ResolveUrl("~")). If you would like that code,
email me, and ill send you the code,
but like i said above, it may not be necessary anymore in 2005.
"Brian" <br***@nospam.com> wrote in message
news:8W*****************@tornado.socal.rr.com...
Well, I'm not quite sure. I don't understand the entire virtual path
thing. But from what I understand, ~ works in preprocessing but not in
html. So css, images, etc are left broken.

The immediate concern is to address the VS 2005 developer server. It runs
the project not from / but from /$(project)/ The project name must be
inserted into every URL. There are workarounds. One suggestion on the
net invoked the developer server executable with arguments to run the
project as the root url. IIS is always a choice. But I'd rather handle
it in the developer server.

Another concern is the portability of the site should it move to a new
location.

Feb 28 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tim Jarman | last post by:
Apologies in advance for the long post - I wanted to be sure I included all the relevant details. The answer is probably very, very simple. I am doing something stupid here, but I don't know what...
5
by: Leszek | last post by:
Hello, Could anybody explain what's a difference between a virtual directory and an application root under IIS? I'm a little bit confused. This is mu problem: Let's assume the following...
3
by: Jiong Feng | last post by:
Hi, I have a question. WE have a web application in web root. And also we have a virtual directory library application. If we change root web.config, the root application will restart....
5
by: TomislaW | last post by:
What is asp.net equivalent for Application("Root") in asp?
10
by: Steve Taylor | last post by:
I am having trouble understanding the ASP.NET application boundaries. Here's my setup: 1. Win2003 Server with IIS 6 and an application defined at the root "SalesNow" (www.salesnow.com). 2. A...
5
by: rdcpro | last post by:
In reading MSDN docs on creating custom Configuration sections, I found this page: ...
7
by: Edward Yang | last post by:
In my test, I have two web applications app1 and app2, and I configure them as follows in IIS: $/comboapps |--web.config |--bin | app1.dll | app2.dll |--app1 | form1.aspx
3
by: Carl Johansen | last post by:
I have a big ASP website (used by several thousand car dealers) that is a collection of lots of small and medium-sized applications. Now I want to start adding ASP.NET applications to it. I have...
5
markrawlingson
by: markrawlingson | last post by:
Hey guys, Having a bit of a complicated issue here so please bare with me while I explain. I'm also not a system admin and don't know a whole lot about IIS, so i apologize in advance. I...
5
by: IUnknown | last post by:
Ok, we are all aware of the situation where modifying the folder structure (adding files, folders, deleting files, etc) will result in ASP.NET triggering a recompilation/restart of the application....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.