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.
 
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

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top