473,770 Members | 2,135 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\myAspS ite) 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 1567
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.goo glegroups.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\myAspS ite) 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
4251
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
8693
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 developing a mid-sized Access database (60 tables, 25 simultaneous users). Although I've been tossing up if I should try to convert the back end to SQL server (We have a license), the performance has been good enough that it always seemed a waste of time,...
2
1676
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 moving a significant amount of content from the ASP classic page (basically formatted text in <P> tags) to an ASP.NET webform, is it better to add it to the webform as HTML or should I put each paragraph into separate (or perhaps a single) ...
5
2527
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 applications. I am testing an upgrade of all of the sites and have converted the main root site...although not necessarily fixed any issues. I move on instead and converted one of the virtual roots that is a seperate
5
2798
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( Outlook.OlItemType.olAppointmentItem); I do not understand how to convert the (Outlook.AppointmentIem) portion of the statement.
8
8437
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
1556
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 save some time. Thanks in advance Al
2
341
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 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.
1
2646
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 a Web Application Project". The issue is that standard ASP.NET controls that are embedded as child controls within the ContentTemplate of the Ajax Control Toolkit's TabContainer/TabPanel are no longer visible to the page (and result in compile...
0
9591
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10228
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10057
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10002
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8883
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6676
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3970
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.