PC Review


Reply
Thread Tools Rate Thread

Converting ASP site to .NET

 
 
engwar1@yahoo.com
Guest
Posts: n/a
 
      10th Mar 2005
I'm a .NET newbie and am beginning the process of converting an
existing personal website to .NET from classic ASP.

I'm assuming I want my aspx files in the root of my site in the same
place as my asp files. In this way when I eventually get switched over
to all aspx files my URLs will not have an extra directory name, only
the extensions will change.

I've got things set up and working on my dev box but have some
questions.

Previously I had my server set up so that the root folder of my web was
a subdirectory of wwwroot (wwwroot\myAspSite) and in IIS set the home
directory of my default website to the subdirectory "myAspSite" so that
http://localhost loads my website. Standard stuff.

When I create a new project in VS it wants me to create a new
subdirectory of "myAspSite". Since what I really wanted was my new
project to be "localhost" this isn't what I intended.

So I changed IIS to use "wwwroot" as my home directory and using VS
created my new project as "myNetSite" under that. Then I moved my old
ASP files to this new directory.

But then I had a problem in that the paths I used were absolute <img
src="/images/foo.jpg"> and I now will have to change them to relative
paths for them to work <img src="..images/foo.jpg"> (same as all my
internal hyperlinks.)

This is because "myNetSite" isn't the root anymore but is a
subdirectory of a root. And my code uses <img src="/images/... to find
graphics etc.

I realized that instead of making these tedious code changes I can just
change IIS to use "myNetSite" as the home directory. The problem here
is that when I launch my app from within VS debug-->Start Without
Debugging that I get an error because it's requesting
http://localhost/myNetSite instead of just http://localhost.

While I can hit my new .aspx pages successfully by typing the correct
address into the browser this isn't a good solution because I can't
debug my pages from within VS.

Should I just replace my absolute paths with relative paths? I prefer
absolute paths and would rather avoid this. Or is there a way to tell
VS to use "localhost" instead of "localhost/myNetSite" when it's
looking for my application? Or some other way to set this up that I
haven't thought of?

Also, when my site is running on the production server my files are all
in "wwwroot" directly so my ISP somehow must be able to make that
directory be the root of my .NET application.

Can anyone clarify or explain this?

Thanks.

 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      10th Mar 2005
Engwar,

There is one simple answer on your long question. Don't try to change
standard setting when you are using VS2002/VS2003 with web development.
Sooner or later you will have a lot of (sometimes unrestorable) problems.

In addition do everything from the VS IDE when you want changes.

Just my thought,

Cor


 
Reply With Quote
 
Nick Malik [Microsoft]
Guest
Posts: n/a
 
      10th Mar 2005
How you develop and how you deploy are two different things.

a) ALWAYS use relative paths. Otherwise, you limit how and where your app
is deployed. You also minimize mistakes.
b) Let VS create the virtual directory for you
(http://localhost/myapp/default.aspx) and use it.
c) When you deploy, the ISP can easily set up the virtual directory to point
directly to your app.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I'm a .NET newbie and am beginning the process of converting an
> existing personal website to .NET from classic ASP.
>
> I'm assuming I want my aspx files in the root of my site in the same
> place as my asp files. In this way when I eventually get switched over
> to all aspx files my URLs will not have an extra directory name, only
> the extensions will change.
>
> I've got things set up and working on my dev box but have some
> questions.
>
> Previously I had my server set up so that the root folder of my web was
> a subdirectory of wwwroot (wwwroot\myAspSite) and in IIS set the home
> directory of my default website to the subdirectory "myAspSite" so that
> http://localhost loads my website. Standard stuff.
>
> When I create a new project in VS it wants me to create a new
> subdirectory of "myAspSite". Since what I really wanted was my new
> project to be "localhost" this isn't what I intended.
>
> So I changed IIS to use "wwwroot" as my home directory and using VS
> created my new project as "myNetSite" under that. Then I moved my old
> ASP files to this new directory.
>
> But then I had a problem in that the paths I used were absolute <img
> src="/images/foo.jpg"> and I now will have to change them to relative
> paths for them to work <img src="..images/foo.jpg"> (same as all my
> internal hyperlinks.)
>
> This is because "myNetSite" isn't the root anymore but is a
> subdirectory of a root. And my code uses <img src="/images/... to find
> graphics etc.
>
> I realized that instead of making these tedious code changes I can just
> change IIS to use "myNetSite" as the home directory. The problem here
> is that when I launch my app from within VS debug-->Start Without
> Debugging that I get an error because it's requesting
> http://localhost/myNetSite instead of just http://localhost.
>
> While I can hit my new .aspx pages successfully by typing the correct
> address into the browser this isn't a good solution because I can't
> debug my pages from within VS.
>
> Should I just replace my absolute paths with relative paths? I prefer
> absolute paths and would rather avoid this. Or is there a way to tell
> VS to use "localhost" instead of "localhost/myNetSite" when it's
> looking for my application? Or some other way to set this up that I
> haven't thought of?
>
> Also, when my site is running on the production server my files are all
> in "wwwroot" directly so my ISP somehow must be able to make that
> directory be the root of my .NET application.
>
> Can anyone clarify or explain this?
>
> Thanks.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting a ASP.Net VB.Net (1.1) Site to C# (3.5)? Volkan Senguel Microsoft ASP .NET 1 5th Aug 2009 01:30 AM
Converting Publisher2007 Web Site to Front Page... Writer1227 Microsoft Access External Data 0 22nd Sep 2008 04:17 PM
Converting Web Site from Vb.Net 2003 to Vb.Net 2005 =?Utf-8?B?U2VyZ2lvIE1hcnRpbnM=?= Microsoft ASP .NET 0 21st Feb 2006 04:28 PM
Converting .pub (publisher) site to Frontpage? =?Utf-8?B?Sm9obg==?= Microsoft Frontpage 6 5th Jan 2006 05:41 PM
Reference Issue converting site from 1.1 to 2.0 =?Utf-8?B?Um9iZXJ0?= Microsoft ASP .NET 5 1st Nov 2005 05:39 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:29 AM.