Directory structures different on development machine vs. install machine.

U

UJ

So I have a project called Fred that's a web site. On my machine, the url is
http://localhost/Fred/..... On the final resting place it's
www.fred.com/...

So how do I make the system so that it will work both in my development
environment and the delivered web site? For instance - I want to do a system
transfer somewhere - but I don't want to specify
"../../LoveItOrLeaveIt.aspx" because the directory structure could change.
And if I try and do "/LoveItOrLeaveIs.aspx" it works on the delivered site
but not the development site.

The only thing I can think of is to make a virtual directory that point to
the root and then have everything point to that.

Anybody have any suggestions?

TIA - Jeff.
 
G

Guest

Hi,
You can use the web application root operator (~), which is resolved to the
root of the current application
for example: Response.Redirect("~/Folder/sample.aspx");
Or you can use it in the server controls
<asp:image runat="server" id="Image1"
ImageUrl="~/Images/SampleImage.jpg" />
Regards,
Mohamed Mosalem
 
U

UJ

Thanks for the info but that doesn't work all the time. One of the things
I'm trying to do is to make the rollover on a few buttons change the graphic
image. But if I put ~/Images it doesn't understand it. The only way I've
been able to make it work is by setting up a virtual directory and reference
that there.

Is there a better way to do this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top