473,378 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Converting ASP site to .NET

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.

Jul 21 '05 #1
2 1529
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
Jul 21 '05 #2
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.
--
<en*****@yahoo.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
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.

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Davinder | last post by:
can anyone recommend a good tool to convert documents to HTML on the fly. I need to integrate this tool with a VB app so it must have an API. thanks in advance Davinder davinder@gujral.co.uk
7
by: RCS | last post by:
Okay, a rather 'interesting' situation has arisen at a place I work: I need to convert a database from Access to something that can be used over the web. I am currently maintaining and...
2
by: Dave | last post by:
I am converting an ASP Classic web site to an ASP.NET application and have some real basic formatting or design questions. (The classic ASP site has both code (forms) and content pages.) 1.When...
5
by: Robert | last post by:
I have a series of web applications (configured as separate applications) on a server. There is a main application at the root and then several virtual directories that are independant...
5
by: Howard Kaikow | last post by:
I'm converting some C# to VB .NET. In an example that uses Outlook, I find the following C# statement: Outlook.AppointmentItem appointment = (Outlook.AppointmentItem)outlook.CreateItem(...
8
by: Howard Kaikow | last post by:
I've been trying to convert the following C# Dispose to VB .NET: protected override void Dispose(bool disposing) { if (excelThread != null) {
3
by: Al | last post by:
Hi Is there any utility available to convert VB.net to asp.net? I have application that I to make it browser based. Before I strart to re write all the Windows based UI I like to know if I can...
2
by: engwar1 | last post by:
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...
1
by: =?Utf-8?B?SG93YXJkIFBpbnNsZXk=?= | last post by:
I'm trying to convert a Web Site to the Web Application project model and I'm running into compile errors that do not seem to be covered by the guidance I found at "Converting a Web Site Project to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.