I have a simple question. I created a new Web thru IIS (MyWeb) that points to c:\Inetpub\wwwroot\MyWeb
Then I created a new asp.net project in VS. The problem that I have is this: when I compile and run the project, it's link looks like this
http://localhost/MyWeb/Default.asp
which means that if in Default.aspx I put a link to "\login.aspx" for example, it will fail, because "\" is "/localhost/". I need to have the root represented by the entire link. Therefore "\login.aspx" should point to "http://localhost/MyWeb/login.aspx" instead of "http://localhost/login.aspx". If it doesnt how am I supposed to work on different projects?? If I need to work on 3 different sites I need each of them to have it's own root..
How can I do that? Thank you
andrewHey Andrew,
Are you talking about Server.MapPath??
Jodie Rapson
"Andrew Parks" <anonymous@.discussions.microsoft.com> wrote in message
news:FA3EFDD8-EBE2-400F-BA8B-DD9BFF40AB64@.microsoft.com...
> I have a simple question. I created a new Web thru IIS (MyWeb) that points
to c:\Inetpub\wwwroot\MyWeb.
> Then I created a new asp.net project in VS. The problem that I have is
this: when I compile and run the project, it's link looks like this:
> http://localhost/MyWeb/Default.aspx
> which means that if in Default.aspx I put a link to "\login.aspx" for
example, it will fail, because "\" is "/localhost/". I need to have the root
represented by the entire link. Therefore "\login.aspx" should point to
"http://localhost/MyWeb/login.aspx" instead of
"http://localhost/login.aspx". If it doesnt how am I supposed to work on
different projects?? If I need to work on 3 different sites I need each of
them to have it's own root...
> How can I do that? Thank you!
> andrew
No, what I mean is, on my development machine the projects are arranged like this
http://localhost/MyWeb1/ (MyWeb1 is the virtual dir setup in IIS
http://localhost/MyWeb2/ (MyWeb2 is the virtual dir setup in IIS
So, to refer a file
http://localhost/MyWeb1/Default.asp
When I deploy the finalized web application on the web it will be something like this
http://some.server.com/Default.asp
If I put a link in Default.aspx that reads: href="http://links.10026.com/?link=\Login.aspx", it will work on the deployed version, as
http://some.server.com/Login.asp
exists, but on the development machine it will not work because it will point to
http://localhost/Login.aspx, instead of http//localhost/MyWeb1/Login.asp
This means that either I have to deploy it as http://some.server.com/MyWeb1/ (which is not cool at all) or I have to work with ALL my projects directly in the root, which again is not good..
How can I do this
than
What are you using to develop? As using "/file.aspx" should work on both
server and dev machine.
Jodie Rapson
"Andrew Parks" <anonymous@.discussions.microsoft.com> wrote in message
news:FA3EFDD8-EBE2-400F-BA8B-DD9BFF40AB64@.microsoft.com...
> I have a simple question. I created a new Web thru IIS (MyWeb) that points
to c:\Inetpub\wwwroot\MyWeb.
> Then I created a new asp.net project in VS. The problem that I have is
this: when I compile and run the project, it's link looks like this:
> http://localhost/MyWeb/Default.aspx
> which means that if in Default.aspx I put a link to "\login.aspx" for
example, it will fail, because "\" is "/localhost/". I need to have the root
represented by the entire link. Therefore "\login.aspx" should point to
"http://localhost/MyWeb/login.aspx" instead of
"http://localhost/login.aspx". If it doesnt how am I supposed to work on
different projects?? If I need to work on 3 different sites I need each of
them to have it's own root...
> How can I do that? Thank you!
> andrew
I use VS2003 and Framework 1.1.
It doesn't work as you say. For instance if I have an image href = "\Images\image1.gif
If I place the file here: c:\Inetpub\wwwroot\MyWeb\Images\image1.gif, it doesnt work. But if I put it here
c:\Inetpub\wwwroot\Images\image1.gif it works.
This is all on the dev machine. This means that "\" = "c:\Inetpub\wwwroot" when I really need it to be "c:\Inetpub\wwwroot\MyWeb". However, after researching a little bit on the web it looks like what I want is not possible. This means that I can only work on 1 project at a time or combine ALL projects in "c:\Inetpub\wwwroot"...
:-
What are you using to dev? As I have been doing this for a few years and
this "/page.aspx" should be fine for test and server.
Jodie
"Andrew" <anonymous@.discussions.microsoft.com> wrote in message
news:2DE4C85F-943B-4499-A145-70FE856DE815@.microsoft.com...
> No, what I mean is, on my development machine the projects are arranged
like this:
> http://localhost/MyWeb1/ (MyWeb1 is the virtual dir setup in IIS)
> http://localhost/MyWeb2/ (MyWeb2 is the virtual dir setup in IIS)
> So, to refer a file:
> http://localhost/MyWeb1/Default.aspx
> When I deploy the finalized web application on the web it will be
something like this:
> http://some.server.com/Default.aspx
> If I put a link in Default.aspx that reads: href="http://links.10026.com/?link=\Login.aspx", it will
work on the deployed version, as:
> http://some.server.com/Login.aspx
> exists, but on the development machine it will not work because it will
point to:
> http://localhost/Login.aspx, instead of http//localhost/MyWeb1/Login.aspx
> This means that either I have to deploy it as
http://some.server.com/MyWeb1/ (which is not cool at all) or I have to work
with ALL my projects directly in the root, which again is not good...
> How can I do this?
> thanx
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment