473,387 Members | 1,876 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,387 software developers and data experts.

Can I Reset the Root from localhost/myproject/ to localhost/

does anyone know if it is possible to alter the root address for an asp.net
project as it is messing up my paths.

When I develop locally the address is
localhost/mywebapplication/default.aspx however when the project is uploaded
to a server it is www.mywebsite.com/default.aspx. If I want to use a fixed
path in files I have to alter the address when it is uploaded .

e.g. when the site is being developed locally i can refer to the home page
as /mywebapplication/default.aspx
however on the server I would use /default.aspx

At the moment I have a function that alter the path as required however this
is a big overhead.

I have looked at configuring both vs.net and IIS but not found any
information.

Alex
Nov 19 '05 #1
4 1525
Alex:
A better alternative is to let ASP.Net work it's magic.

Instead of hardcoding paths such as /mywebSiteApplication/default.aspx,
simply use:

~/default.aspx which ASP.Net will automatically handle for you

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Alex" <al*********@hotmail.co.uk> wrote in message
news:uN**************@TK2MSFTNGP12.phx.gbl...
does anyone know if it is possible to alter the root address for an asp.net project as it is messing up my paths.

When I develop locally the address is
localhost/mywebapplication/default.aspx however when the project is uploaded to a server it is www.mywebsite.com/default.aspx. If I want to use a fixed
path in files I have to alter the address when it is uploaded .

e.g. when the site is being developed locally i can refer to the home page
as /mywebapplication/default.aspx
however on the server I would use /default.aspx

At the moment I have a function that alter the path as required however this is a big overhead.

I have looked at configuring both vs.net and IIS but not found any
information.

Alex

Nov 19 '05 #2
We have done this for now but because we have also have legacy ASP pages. If
I remember we just moved the site to localhost and we connected to wwwroot$.

That said I wouldn't recommend this for a native ASP.NET application. AFAIK
making the path relative to the root application is really easy with the ~
notation and should be negligable from a performance point of view.

How do you currently fix your path ?

Patrice

--

"Alex" <al*********@hotmail.co.uk> a écrit dans le message de
news:uN**************@TK2MSFTNGP12.phx.gbl...
does anyone know if it is possible to alter the root address for an asp.net project as it is messing up my paths.

When I develop locally the address is
localhost/mywebapplication/default.aspx however when the project is uploaded to a server it is www.mywebsite.com/default.aspx. If I want to use a fixed
path in files I have to alter the address when it is uploaded .

e.g. when the site is being developed locally i can refer to the home page
as /mywebapplication/default.aspx
however on the server I would use /default.aspx

At the moment I have a function that alter the path as required however this is a big overhead.

I have looked at configuring both vs.net and IIS but not found any
information.

Alex

Nov 19 '05 #3
Hi

I figured out how to solve the problem and the answer was so simple when I
started playing around with IIS5.0

If anyone wants to know how to set your asp.net app as the root e.g
http://localhost/default.aspx heres the answer

Open up the IIS Control Panel

Right click on the Default Website node

Choose the Properties menu

Select the Tab marked Home Directory

And set the local path to the path that contains your application.
I cannot believe it turned out to be so easy and so obvious. Obviously you
will have to alter the path when you work on different project however that
s not really a big problem considering the benefits (and no bloody
serverside processing of the ~/folder/ command.
hope this helps

alex
Nov 19 '05 #4
why not use Control.ResolveUrl?
http://msdn.microsoft.com/library/de...veurltopic.asp

e.x.:
override void OnLoad(object sender)
{
Response.Write("Path=" + ResolveUrl("~/"));
}
"Alex" <al*********@hotmail.co.uk> wrote in message
news:uN**************@TK2MSFTNGP12.phx.gbl...
does anyone know if it is possible to alter the root address for an
asp.net
project as it is messing up my paths.

When I develop locally the address is
localhost/mywebapplication/default.aspx however when the project is
uploaded
to a server it is www.mywebsite.com/default.aspx. If I want to use a fixed
path in files I have to alter the address when it is uploaded .

e.g. when the site is being developed locally i can refer to the home page
as /mywebapplication/default.aspx
however on the server I would use /default.aspx

At the moment I have a function that alter the path as required however
this
is a big overhead.

I have looked at configuring both vs.net and IIS but not found any
information.

Alex

Nov 19 '05 #5

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

Similar topics

5
by: MLH | last post by:
I'm supposed to set a password for the MySQL root user. The output of mysql_install_db instructed me to run the following commands... /usr/bin/mysqladmin -u root -h appserver password mynwewpasswd...
3
by: Ryan Taylor | last post by:
Hello. I am writing an ASP.NET C# application. I have made a user control so that I can reuse some code. However, I need to be able to determine what the virtual root of the website is, so that...
19
by: Steve Franks | last post by:
I am using VS.NET 2005 beta 2. When I run my project locally using the default ASP.NET Development Web Server it runs using a root address like this: http://localhost:11243/testsite/ However...
2
by: Jack | last post by:
To whom may concern: 1. Web.config <authentication mode="Forms"> <forms name=".Portal" protection="All" timeout="3600" loginUrl="Login.aspx" /> </authentication> 2. The "Login.aspx" is in...
0
by: damontimm | last post by:
My setup: Mac OS 10.4.4; mysql 4.x ... everything was installed and working fine for some time. Today, I added drupal to my system and had to create a new database in mysql -- now I am having some...
2
by: MilanB | last post by:
Hello, I created HttpHandler to redirect root Default.aspx. But I don't know how to create path, that will redirect just web root Default.aspx. I tried following line, but it redirects all...
7
by: rajbala.3399 | last post by:
Hi , I want to download sql in my linux system........... # rpm -ivh MySQL-server-5.0.24a-0.glibc23.i386.rpm MySQL-cl ient-5.0.24a-0.glibc23.i386.rpm Preparing... ...
3
by: Chris | last post by:
When I go into debug mode and the web page I am working on opens in the browser via the local Cassini Web Server I get a path appended onto the full path e.g. ...
2
by: ivytony | last post by:
First of all, I'm not sure if I've set up root password for MySQL server or not. I was following this tutorial http://www.howtoforge.com/centos-5.1-server-lamp-email-dns-ftp-ispconfig-p4 to install...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.