473,287 Members | 1,565 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,287 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 1524
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.