How to create a website without virtual directory?

  • Thread starter Thread starter ningjun.wang
  • Start date Start date
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.
 
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/
======================================
 
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
 
Back
Top