How to create a website without virtual directory?

M

Mark Fitzpatrick

You don't really. The only other way to do this would be to install IIS and
not use the VS-net web server and create your site at the IIS root
(inetpub/wwwroot). This doesn't really matter though as any well-designed
app can move from a sub-directory to a root directory. Code image and urls
against the application root and you'll be fine, that way when you move to
another directory level the links and resources will always be referenced
relative to the root of the application.
 
J

Juan T. Llibre

Follow the instructions given by Scott Guthrie in this blog post:

"How to Run a Root "/" Site with the Local Web Server using VS 2005 SP1" :
http://weblogs.asp.net/scottgu/arch...h-the-local-web-server-using-vs-2005-sp1.aspx

If you haven't install VS 2005 SP1...do it.
It fixes many other problems...and lets you run websites as the root with the internal web server.



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
N

ningjun.wang

Mark:
Code image and urls
against the application root and you'll be fine, that way when you move to
another directory level the links and resources will always be referenced
relative to the root of the application.

How do I do that? If I use <img src="/website1/images/xyz.gif">, it
works in Visual Studio but not on production. If I use <img src="/
images/xyz.gif">, it works on production but not on Visual Studio. I
also tried <img src="~/images/xyz.gif">, it does not work.

Same problem with css. If I use
<link href="/css/style.css" rel="stylesheet" type="text/css">, it
works on production but not on Visual Sudio.

Please advise.

Thanks
 

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

Top