473,396 Members | 1,921 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,396 software developers and data experts.

migrating ASP to ASP.NET

I would really appreciate recommendations for sources of materials on
migrating ASP applications to ASP.NET (books, URL's, etc.). Also, is there a
magazine that is particularly good for .NET stuff. I am just starting my
journey into the .NET world, moving from a pure ASP one.
Nov 19 '05 #1
3 1809
Hi Bob,

Steps to follow in order to pass to ASP.NET after that the installation of
the
.NET Framework and VS.NET has been completed:

1.Create a copy of the directory (\MYSITE) containing the existing ASP web
application
and rename it (\MYSITE_NET).
2.Make the new /MYSITE_NET directory a virtual directory through IIS or PWS.
3.Open VS.NET and create a new empty Web project
(/MYSITE_NET/myPrjNet.vbproj).
4.Add to the new project the asp files from our web application. To do this,
from the "Solution Explorer"
window, right-click on myPrjNet.vbp and choose "Add" -> "Add Existing
Item..." The file select window
will open in order for you to select the files - to view ASP files select
the filter "Web Files."

Start the .NET Application
The first step in migrating the application is to set the default start page
(the first file that is executed
when we run the application). You can do this by right-click on the
appropriate file in the "Solution Explorer"
window and selecting "Set As Start Page." For example:
/MYSITE_NET/default.asp. At this point, we can
already execute our application by starting it (without debugging) by
pressing CTRL+F5. As long as your
browser is in "online" mode and your local web server is started it should
work as always.

ASP.NET is perfectly compatible with ASP and the two co-exist quite well
together. If we experiment and try
renaming our ASP files to ASPX things change a little.

Rename MyForm.asp To MyForm.aspx
At this point we can try the experiment mentioned previously: we'll choose
an ASP file and tell Visual Studio to
exclude it from the project. You do this by right-clicking on the file in
the "Solution Explorer" window and selecting
"Exclide From Project." Once the file is excluded, we'll rename it and then
re-add it as we did originally. You'll most
likely see a message something like this:
"There is no class file in the project associated with the Web Form
'MyForm.aspx'. Create a new class file now?"
You'll probably want to select the "Yes" button. The framework, at this
point, will do two things:
It will insert the following line at the top of MyForm.aspx:
<%@ Page CodeBehind="MyForm.aspx.vb" Language="vb"
Inherits="myPrjNet.MyForm">
This directive to the compiler that is included in most all ASP.NET files
provides a number of pieces of information so
the compiler can compile the page correctly. The main parameters are:

[CodeBehind]: Where to find the code, that is the class, that is "behind"
the ASPX page. In our sample case it would MyForm.aspx.vb.
[Language]: The language used: VB, C#, etc...
[Inherits]: The parent class from which our page inherits attributes and
methods. Almost always defined in the codebehind file.
[Debug]: Indicates whether the page should be executed in debug mode. Must
be either True or False. As we've already mentioned,
this option does not have to be set in the individual file. You can set it
in the web.config file for all pages in the project.

It will generate the file MyForm.aspx.vb:
Effectively what we want to do is to move nearly all of the code written in
the original page (MyForm.asp) to the new
code-behind file (MyForm.aspx.vb). In particular, all the Functions and Subs
defined in the original asp file will now
become methods of our class (after we've added the correct modifier -
Public, Protected. or Private). All classes
defined in this way derive from the parent class: System.Web.UI.Page and
possess two main Private methods:
Page_Init() and Page_Load(). More information on the parameters and use of
these methods can be found on
the web and in the .NET Framework documentation.

After you've moved all the event handlers and code to the MyForm.aspx.vb
file, the "operating" code, that is the
code remaining between the <body> tags should be all that remains in the
ASPX page. Most of the common errors
you'll run into when migrating are results of the changes from VB to VB.NET:

All variables must be declared and eventually typed. The "Variant" type no
longer exists. Unspecified variables default to
the generic "Object."
All method calls require parentheses.The instructions Set and Let are no
longer necessary (everything is now an object!).

Obviously it is not necessary to convert all your ASP pages to ASP.NET As
we've already mentioned, the two can inhabit
the same atmosphere and can calmly co-exist. But, if we declare of variable
of session scope in an ASP.NET page, it will
not be visible to and ASP pages. It is therefore necessary to convert all
the files which need to access these variables to
ASP.NET using the method described above.

As for read up for .NET, you can refer to the online MSDN which has
exhaustive
study material for .NET.The link is as follows.
http://msdn.microsoft.com/default.aspx

HTH

Mona

"BobRoyAce" <bo*@omegasoftwareinc.com> wrote in message
news:2J********************@comcast.com...
I would really appreciate recommendations for sources of materials on
migrating ASP applications to ASP.NET (books, URL's, etc.). Also, is there
a magazine that is particularly good for .NET stuff. I am just starting my
journey into the .NET world, moving from a pure ASP one.

Nov 19 '05 #2
Wow, Mona, you went above and beyond with that response...a lot of helpful
information indeed and muchly appreciated. Though I know that ASP and
ASP.NET pages can peacefully coexist, as you pointed out, we ultimately want
to move all of the pages (and there are MANY!) to .NET. We actually hope to
automate part of it, as much as possible, anyway, but that's another story.
Anyway, thanks again for your input!

"Mona" <Mo**@discussions.microsoft.com> wrote in message
news:eM**************@TK2MSFTNGP15.phx.gbl...
Hi Bob,

Steps to follow in order to pass to ASP.NET after that the installation of
the
.NET Framework and VS.NET has been completed:

1.Create a copy of the directory (\MYSITE) containing the existing ASP web
application
and rename it (\MYSITE_NET).
2.Make the new /MYSITE_NET directory a virtual directory through IIS or
PWS.
3.Open VS.NET and create a new empty Web project
(/MYSITE_NET/myPrjNet.vbproj).
4.Add to the new project the asp files from our web application. To do
this,
from the "Solution Explorer"
window, right-click on myPrjNet.vbp and choose "Add" -> "Add Existing
Item..." The file select window
will open in order for you to select the files - to view ASP files
select
the filter "Web Files."

Start the .NET Application
The first step in migrating the application is to set the default start
page
(the first file that is executed
when we run the application). You can do this by right-click on the
appropriate file in the "Solution Explorer"
window and selecting "Set As Start Page." For example:
/MYSITE_NET/default.asp. At this point, we can
already execute our application by starting it (without debugging) by
pressing CTRL+F5. As long as your
browser is in "online" mode and your local web server is started it should
work as always.

ASP.NET is perfectly compatible with ASP and the two co-exist quite well
together. If we experiment and try
renaming our ASP files to ASPX things change a little.

Rename MyForm.asp To MyForm.aspx
At this point we can try the experiment mentioned previously: we'll choose
an ASP file and tell Visual Studio to
exclude it from the project. You do this by right-clicking on the file in
the "Solution Explorer" window and selecting
"Exclide From Project." Once the file is excluded, we'll rename it and
then
re-add it as we did originally. You'll most
likely see a message something like this:
"There is no class file in the project associated with the Web Form
'MyForm.aspx'. Create a new class file now?"
You'll probably want to select the "Yes" button. The framework, at this
point, will do two things:
It will insert the following line at the top of MyForm.aspx:
<%@ Page CodeBehind="MyForm.aspx.vb" Language="vb"
Inherits="myPrjNet.MyForm">
This directive to the compiler that is included in most all ASP.NET files
provides a number of pieces of information so
the compiler can compile the page correctly. The main parameters are:

[CodeBehind]: Where to find the code, that is the class, that is "behind"
the ASPX page. In our sample case it would MyForm.aspx.vb.
[Language]: The language used: VB, C#, etc...
[Inherits]: The parent class from which our page inherits attributes and
methods. Almost always defined in the codebehind file.
[Debug]: Indicates whether the page should be executed in debug mode. Must
be either True or False. As we've already mentioned,
this option does not have to be set in the individual file. You can set it
in the web.config file for all pages in the project.

It will generate the file MyForm.aspx.vb:
Effectively what we want to do is to move nearly all of the code written
in
the original page (MyForm.asp) to the new
code-behind file (MyForm.aspx.vb). In particular, all the Functions and
Subs
defined in the original asp file will now
become methods of our class (after we've added the correct modifier -
Public, Protected. or Private). All classes
defined in this way derive from the parent class: System.Web.UI.Page and
possess two main Private methods:
Page_Init() and Page_Load(). More information on the parameters and use of
these methods can be found on
the web and in the .NET Framework documentation.

After you've moved all the event handlers and code to the MyForm.aspx.vb
file, the "operating" code, that is the
code remaining between the <body> tags should be all that remains in the
ASPX page. Most of the common errors
you'll run into when migrating are results of the changes from VB to
VB.NET:

All variables must be declared and eventually typed. The "Variant" type no
longer exists. Unspecified variables default to
the generic "Object."
All method calls require parentheses.The instructions Set and Let are no
longer necessary (everything is now an object!).

Obviously it is not necessary to convert all your ASP pages to ASP.NET As
we've already mentioned, the two can inhabit
the same atmosphere and can calmly co-exist. But, if we declare of
variable
of session scope in an ASP.NET page, it will
not be visible to and ASP pages. It is therefore necessary to convert all
the files which need to access these variables to
ASP.NET using the method described above.

As for read up for .NET, you can refer to the online MSDN which has
exhaustive
study material for .NET.The link is as follows.
http://msdn.microsoft.com/default.aspx

HTH

Mona

"BobRoyAce" <bo*@omegasoftwareinc.com> wrote in message
news:2J********************@comcast.com...
I would really appreciate recommendations for sources of materials on
migrating ASP applications to ASP.NET (books, URL's, etc.). Also, is there
a magazine that is particularly good for .NET stuff. I am just starting my
journey into the .NET world, moving from a pure ASP one.


Nov 19 '05 #3
Check out the following section of the .Net SDK online:

http://msdn.microsoft.com/library/de...ppagetoasp.asp

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"BobRoyAce" <bo*@omegasoftwareinc.com> wrote in message
news:2J********************@comcast.com...
I would really appreciate recommendations for sources of materials on
migrating ASP applications to ASP.NET (books, URL's, etc.). Also, is there
a magazine that is particularly good for .NET stuff. I am just starting my
journey into the .NET world, moving from a pure ASP one.

Nov 19 '05 #4

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

Similar topics

0
by: Zvika Glickman | last post by:
I'm migrating DB2 to ORACLE 9I. In the DB2 schema each table defined in diferrent tablespace. Few tablespaces are define on the same STOGROUP (there are few STOGROUP). It's a big db (few terra...
0
by: steve | last post by:
I am having huge problems migrating large db’s from one server to another. I use phpmyadmin to dump the data into a file, and then migrate it to my production server. Then I try to use this:...
4
by: Bernardo Robelo | last post by:
Hi, I am interested in migrating Microsoft Access database to Postgres database. But I do not have idea of like initiating. Maybe some tool exists for this problem. Thanks you. Bernardo
4
by: Juan | last post by:
I'm migrating a VB.Net app to c# and found the following: Private m_State(,) As Integer If anyone knows what is the analogous in c#... is it an array? Thanks, Juan.
6
by: Shai Levi | last post by:
Hi, I'm trying to migrate native c++ class to managed c++ class. The native class header definition looks as: class NativeClass { public: typedef void (CbFunc1)(int n,void* p);
2
by: Jean-Claude Adams | last post by:
Hi Folks. I need some tutorial or some expertice about the subject. Because, i'm have a customer, need's change the actual appl, but the only issue is a dbf database, and the GUI is the older...
4
by: Collin Peters | last post by:
I have searched the Internet... but haven't found much relating to this. I am wondering on what the best practices are for migrating a developmemnt database to a release database. Here is the...
12
by: jdokos | last post by:
Does anyone know of any good sources (white papers, etc.) regarding migrating from Teradata to DB2 UDB EEE? We are in the very beginning stages of investigating this as an option for some of the...
34
by: subramanian100in | last post by:
Is there any difference between porting and migrating. Kindly explain
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.