ASP.NET - Migration from ASP to ASP.net  ASP.NET - Migration from ASP to ASP.net

Asked By Shiv Kant Pandey
19-May-11 03:17 AM
How to convert ASP site to ASP.NET site using C#
  dipa ahuja replied to Shiv Kant Pandey
19-May-11 03:25 AM
http://www.asp.net/downloads/archived-v11/migration-assistants/asp-to-aspnet
  Reena Jain replied to Shiv Kant Pandey
19-May-11 03:29 AM
hi,

ASP.NET framework is very much different from unstrucured ASP and there is no correct way to just transform it into ASP.NET pages, and if you really want to convert your application and make it ASP.NET based then you have to remodel it and code again almost all the pages , the most prominnet reason why you will do this are

  •  ASP supported scripting languages such as VB Script or Javscript while ASP.NEt supports proper Object oriented languages such as C# or VB.NET etc
  •   In ASP.NET you do proper Event based programming which was impossible in ASP
  •   ASP.NET seperates the code part from HTML parts , which in case of ASP all mixed up
  •   ASP.NET introduced server controls which aree much powerful then ASP controls
hope this will help you
  Ravi S replied to Shiv Kant Pandey
19-May-11 03:30 AM
HI

try this code
<%@ Page Language="c#" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<script runat="server"> 


protected void Page_Load(object sender, System.EventArgs e)
{
	// Set values and format links 
	FormatLinks(HyperLink1, "1.aspx", "One");
	FormatLinks(HyperLink2, "2.aspx", "Two");
	FormatLinks(HyperLink3, "3.aspx", "Three");
}

protected void FormatLinks(HyperLink myLink, string strPage, string strLinkText)
{
// Declare constants
string strRootLink = "http://somewhere/";
string cssClass1 = "current";
string cssClass2 = "nav";

// Get current file name
string strUrl = Request.ServerVariables("script_name");

// Set Link text and URL
myLink.Text = strLinkText;
myLink.NavigateUrl = string.Concat(Strings.Chr(34), strRootLink, strPage);

// If hyperlink is within a label, set CSS class
if ((myLink.Parent is Label)) {
// Get reference to the label the contains the hyperlink
Label myLabel = (Label)myLink.Parent;

// Set CSS class
if ((strUrl.Contains(strPage))) {
myLabel.CssClass = cssClass1;
} else {
myLabel.CssClass = cssClass2;
}
}
}

</script> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"> 
       
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
       
<title>Untitled Page</title> 
       
<style type="text/css"> 
               
.current { 
                        font
-family:Arial, Helvetica, sans-serif; 
                        font
-size:12px;                          color:blue; 
                        background
-color:#FF0000; 
               
} 
 
               
.nav { 
                        font
-family:Arial, Helvetica, sans-serif; 
                        font
-size:12px; 
                        color
:red; 
               
} 
       
</style> 
</head> 
<body> 
       
<form id="form1" runat="server"> 
       
<div> 
               
<table> 
                       
<tr> 
                               
<td align="center"> 
                                       
<asp:Label ID="Label1" runat="server"> 
                                               
<asp:HyperLink ID="HyperLink1" runat="server"></asp:HyperLink> 
                                       
</asp:Label> 
                                       
<br /> 
                                       
<asp:Label ID="Label2" runat="server"> 
                                               
<asp:HyperLink ID="HyperLink2" runat="server"></asp:HyperLink> 
                                       
</asp:Label> 
                                       
<br /> 
                                       
<asp:Label ID="Label3" runat="server"> 
                                               
<asp:HyperLink ID="HyperLink3" runat="server"></asp:HyperLink> 
                                       
</asp:Label> 
                               
</td> 
                       
</tr> 
               
</table> 
       
</div> 
       
</form> 
</body> 
</html>

refer the links also

     http://msdn.microsoft.com/en-us/library/dddsc60w(v=vs.71).aspx
http://forums.asp.net/t/1112688.aspx/1
http://www.asp.net/downloads/archived-v11/migration-assistants/asp-to-aspnet
  James H replied to Shiv Kant Pandey
19-May-11 04:09 AM
Hi 

Migration from ASP to ASP.NET can drastically improve the performance of your applications. A software created using ASP.NET is more robust, scalable, reliable, and secure as compared to the software created using ASP. ASP.NET, which is a new version of ASP, removes all the shortcomings of ASP. For example, it removes tier confusion from the code (by providing an easy way to separate http://www.15seconds.com/issue/070816.htm# layer, business logic layer, and database layer), it allows code compilation instead of code interpretation, and provides CLR (Common Language Runtime) for built in garbage collection to avoid memory leaks.

ASP.NET, which uses .NET Framework, enables you to build globally distributed applications with Internet functionality and http://www.15seconds.com/issue/070816.htm# built into them. ASP.NET enables you to build platform independent software that can be easily integrated with any application developed on any platform and language that supports CLR. The .NET platforms now support approximately 25 .NET compatible languages as compared to ASP, which can support only two scripting languages -- VBScript and JavaScript.

ASP to ASP.NET migration can open a whole new world of possibilities for your web-based applications. For example, you can make use of already existing XML web services in your code to add a new feature or functionality to your code. XML Web services can be utility programs created by any developer and can be made available through Internet world wide without worrying about the operating system and programming language used to create them. Consider a situation where you want to validate the credit card number of your online customers on your website. Instead of writing the code to validate the credit card numbers of the customers yourself, you can simply plug in the already available Web service providing credit card validation in your code.

In addition, the ASP.NET migration can make the code of your http://www.15seconds.com/issue/070816.htm#considerably small, easily manageable, and easily deployable. This white paper discusses the benefits that you may get, after the migration of your application from ASP to ASP.NET. It provides all the valuable information in understanding the important aspects of migration from ASP to ASP.NET and provides a clear insight into the benefits of proposed migration. This paper will help you understand the complexities of a migration and explain how to enable a smooth .NET migration of your ASP code. Furthermore this paper discusses the issues that you must consider before considering a migration and the various migration strategies available.

Benefits of ASP to ASP.NET Migration

http://www.15seconds.com/issue/070816.htm# .NET Framework is rapidly gaining momentum as a standard for business systems, both within an organization and for the external clients of an organization. The advantages of migration of your existing applications to ASP.NET are enormous and disadvantages are none. This is because all the features of asp are available in ASP.NET. Installing ASP.NET does not break your existing ASP applications. ASP.NET uses a separate file name extension (.aspx instead of .asp), separate configuration settings, and an entirely separate runtime technology. With an ASP application entire web server may go down if one application crashes but ASP.NET processes run in a different server space and in separate application domain. This saves entire web server to crash just because of one application. If ASP and ASP.NET are installed on the same computer, ASP pages and applications can continue to use the existing ASP engine, with no interference from ASP.NET.

Some other benefits of ASP to ASP.NET Migration are:

  • Better Language Support: ASP.NET is platform independent technology and supports 25 .NET languages such as C#, VB.NET, and JavaScript. .NET Developers can visually create Web pages with the use of VB style drag drop feature in Visual Studio.NET IDE. They can use built in debugging, testing and deployment features of .NET platform for easy manageability of code. In addition developers can use over 4500 .NET framework classes that provides a number of controls for performance monitoring, logging, file upload, image generation, XML processing, data access, transactions, regular expressions, message queuing, SMTP mail and much more.

  • Event-Driven Programming: ASP.NET is an object oriented technology that supports event driven programming unlike ASP. Objects on a Web page can expose events that can be processed by ASP.NET code. Load, Click and Change events handled by code makes coding much simpler and better organized.

  • Improved Scalability: ASP.NET has removed the bottlenecks created by ASP sessions, which used to work well only on the server where they were created. They used to store the session data "in-process" on the web server, which was a cause of scalability bottlenecks on high-volume sites. ASP.NET stores session's data on a dedicated state server that can be easily shared by multiple web servers and on an SQL Server database too, providing a better scalability and availability of sessions. This has improved the server to server communication, making it possible to scale an application over several servers. One example of this is the ability to run XML parsers, XSL transformations and even resource hungry session objects on other servers.

  • Improved Performance: ASP.NET highly improves the performance of your code because it uses caching in code with automatic content expiration. This feature automatically expires and refreshes data from the cache. This automatically solves the problems of memory leaks from your application and improves the performance of your application. ASP.NET performs dynamic compiled execution of code, which allows fast retrieval of pages as compared to ASP, which requires each page to be interpreted when it is requested by the client. The dynamic compilation automatically detects changes in the code and stores the compiled code in memory to serve the future requests by the web server.

  • Easier Configuration and Deployment: ASP.NET use XML (extensible markup language) file within the application to store application configurations. The configuration files used by ASP.NET applications can be changed and uploaded while the application is running without restarting the server. The web applications are simply copied to the server without the need to run regsvr32 to register any application components and configuration settings.

  • Easier Code Maintenance: ASP.NET enables easy code maintenance because it separates presentation layer from business logic layer. Developers with relevant expertise in front end and back end programming can easily maintain code as compared to ASP, where a single file is used to write HTML, VB script, Java script, and ASP code.

Fundamental Changes in Code

Both ASP and ASP.NET can coexist with each other. ASP and ASP.NET applications can run side by side on a server without having adverse affect on each other. Both applications use separate file extensions, configuration models, and processing engines. For example an ASP application uses .asp extension and a .NET application uses .aspx extension. The configuration in ASP is done using registry but ASP.NET uses XML-based configuration files. You can have one part of an application running ASP and another part of the same application running ASP.NET. All these features are very beneficial if you need to move a large, rapidly changing site to ASP.NET one piece at a time.

The fundamental changes that may occur in the code after migration can be categorized into following categories:

  • Core API Changes: These changes refer to the changes made to the API method calls while migration. For example the changes that would occur when you make the calls related to Request, Response, and Server objects. Usually the method of making calls is same but if there are multiple values for a given key for collection objects different method to return the collection of values is used.

  • Structural Changes: These changes refer to the changes that affect the layout and coding style of an application. For example ASP.NET pages only support one language on a single page where as ASP allowed multiple languages to be used on a single page. ASP.NET page functions must be declared in <script runat=server> blocks where as in ASP, page functions are declared within <% %> blocks. In ASP.NET, page functions must be declared in <script runat=server> blocks whereas ASP.NET does not support page-render functions.

  • Visual Basic Language Changes: VB.NET is a complete programming language as compared to VB Script that was used in ASP. Some of the changes include the removed use of VARIANT data type and Option Explicit. The variable declared with VARIANT data type needs to be transformed to some basic data types. The Option Explicit is made a default feature. Some other keywords such as LET and SET are not supported and Integer values are now 32 bits and Long types have become 64 bits.

  • COM-Related Changes: VB.NET code migration does not force you to incorporate any COM-related changes in your code. Most of these changes are back stage changes and are done automatically. Some changes include the change in threading model, early binding and late binding changes, and changes in OnStartPage and OnEndPage methods in the code.

  • Application Configuration Changes: ASP.NET requires you to store all your configuration settings in Web.config file, which is available in the main application directory.

  • State Management Issues: ASP.NET does not require you to change your Session or Application objects. On the other hand it provides State Management Options for Inproc, StateServer, SqlServer for improved control on your applications. If your application is partially migrated to .NET platform then you cannot share state variables stored in the intrinsic Session or Application objects in your application with .NET pages. You need to duplicate this information in both systems, till the complete migration takes place.

  • Security-Related Changes: ASP.NET supports Windows, Passport, and Forms-based authentication, including cookie management and automatic redirecting of unauthorized logins. All these authentication methods were also available in ASP but Passport based authentication in a new feature added to ASP.NET. Unlike ASP, ASP.NET does not do per-request impersonation. It does not allow your code to run on behalf of authenticated user. You can still use your old authentication methods and perform custom user and login checking using other authentication methods.

  • Data Access: ASP.NET uses ADO .NET, which offers an enormous range of features as compared to ADO to improve your data access methods. It offers powerful new features to get you data from database. Though you need not make any code changes for migration but you can make use of all ADO.NET features in your code.

Migrating Existing Applications to ASP.NET

Although migration of your existing applications to ASP.Net can be very beneficial, sometimes people are reluctant to make this transition. This may be due to many reasons. One of ASP's great assets is that it allows you to use a very simple scripting language, which is not the case with .NET platform. .NET uses modern, full-featured programming languages. ASP.NET therefore places much greater demands on web developers, compared to those placed on conventional software developers.

In ASP, executing the principles of good design is extremely difficult. ASP applications are complex and difficult to maintain, with very low code re-use. On the other hand with .NET there is an opportunity to produce better-designed applications, with resulting benefits in sustaining the quality.

However these design skills are new demands on ASP programmers, and have a long and steep learning curve. While it is very much possible to write ASP.NET applications in the ASP style, this will reverse many of the advantages of .NET technology.

Developers who have not come from a traditional software development background may require more extensive training to adapt to the new concepts. Even experienced software developers may not have fully used object orientated features previously. There could be performance scaling down and productivity decline while developers get accustomed to .NET.

Facts to Consider Before Migration

Before you go for a migration you must determine the benefits that you expect from the migration and the time that you can afford to spare for the migration process. You must also understand the complexity of migration in your application. If you have a big application with number of modules, the quality of the code, the use of COM components, and the distribution of data access functions in the code are few important factors that must be considered before you go for migration.

The greatest difficulty in all programming is good design. If your code has a good design and the multi-tiered separation exists in your application code then the migration process can be smooth else the migration process will be complex and would require a huge amount of effort. A good code design implies that the presentation layer is separated from the business components layers and data access functions reside centrally in data tier.

Changing an ASP page's file extension from .asp to .aspx and correcting for some syntactical changes is usually enough to get an ASP page working as an ASP.NET page. Such an approach, although it can be completed quickly, does not take advantage of many of the new features of .NET, including ASP.NET Web controls, Microsoft ADO.NET, the Microsoft .NET Framework classes. It is better to follow a complete lifecycle of migration and evaluate the complexity of your code to provide the best ASP.NET migration solution for your ASP code.

Although the complete migration of a site in one go is possible, it is often better to use a modular approach. The decision to go for a modular migration or full fledged migration is based on the size and complexity of the application. The simple and small web sites can be migrated to .NET platform in one go but big, complex, and mission critical business applications should be migrated using a modular approach.

Migration Strategies

If a company is going to put forth the effort to move their software to ASP.NET platform then this migration may be a long-termhttp://www.15seconds.com/issue/070816.htm# for the company. This can be an opportunity to make as many architectural and design improvements as possible in the existing code. In such a scenario, a phased approach for migration is must, where both ASP and ASP.NET modules coexist, till complete migration takes place.

If a company is looking for long-term benefits from the migration then the company can follow the approaches given below:

Co-Existence

In this approach, you can have the ASP and ASP.NET modules existing together. You can perform migration for a specific functionality of an application and ensure that the migrated module would still interoperate with the existing application. At Hanu, we follow the following co-existence strategies:

  • Migrating Shared Pages: In this approach we select only those pages first that share their code with other pages. These pages are common pages having intensive code processing and the potential for caching. This enables the important and complete sections of the applications to be migrated first. After this migration both ASP and ASP.NET would be running simultaneously and ASP pages will be using ASP.NET code.

  • Migrating New Pages: In this approach we select only those pages, which need to be added to the application for additional functionality. These pages can be entirely new pages or existing pages that require major code changes. This is the most comfortable approach without affecting the existing functionality. This also restricts new bugs to the new pages only.

  • Migrating Entire Tier or Entire Module: In this approach, we either select an entire module for migration or migrate the application tier by tier. This can be done using Horizontal and Vertical migration strategies. Both these migration strategies will be discussed in the next section of this paper.

Build the Roadmap

In this approach, to get long term benefits of migration, you decide to http://www.15seconds.com/issue/070816.htm# in re-architecting a system so that you can make the best use of .NET framework. The primary objective of this approach is to provide a comprehensive and detailed design for future project developments.

Full Fledged

In this approach you may want a full fledged migration of your system with the plans for change in application design, development, and deployment. This may be due to some strategic business needs.

There are basically two co-existence migration strategies: Vertical and Horizontal Migration. Both of these strategies offer a modular approach for migration.

Vertical Migration

Vertical migration refers to migrating an application one tier at a time, as shown in the Figure given below. For example, consider you have a three tier HR application, which consist of three modules, Recruitment, Leaves Management, and Salary Management. The three tiers used by the application include the user interface, business components, and database.

Vertical migration approach would proceed through all the pages of the user interface tier for each module, followed by the business component and data interface tiers, as shown in the figure given below:

The vertical migration is most appropriate when the application's modules are tightly coupled and minimal changes are required to the interfaces between application tiers. The initial architectural review in this case could yield opportunities for shared code across all three tiers rather than result in separating the modules into distinct applications.

Horizontal Migration

Horizontal migration refers to migration of an application module by module, completing the migration for all three tiers of one module before moving on to the next. As shown in the Figure given below. For example Horizontal migration would proceed through entire Recruitment Module first with all the three tiers (user interface, business components, and database) migrating together for that module. After the recruitment module is completely migrated the other two modules Leaves Management, and Salary Management will be migrated.

A horizontal migration is most appropriate when application modules are loosely coupled and when interfacing between different application tiers is a tedious task. An architectural review all of the application's modules should be conducted before any module migration begins. This review should uncover opportunities for creating reusable code, and may lead to separating the modules into independent applications.

Migration Life Cycle

We believe that no tool currently available is capable of providing a smooth and complte migration process. Tools can be used for basic migration but advanced migration requirements of the code can only be fulfilled using manual intervention in code. The complete migration lifecycle consists of four main stages.

  • Analysis: At this stage, you analyze the existing code, and create a migration strategy. You should consider the scope of migration, the processes required for migration such as code modification and testing plans. At this stage you should also identify the .NET specific functionality that can be added to the application or can be replaced with ASP.NET functionality.

  • Conversion: At this stage, you perform the actual code conversion. Start developing and modifying modules for migration. You should also perform unit testing and peer reviews for the converted code.

  • Re-factoring: At this stage, you perform code optimization and design improvement. This stage can actually enable you to get long terms gains from the migration and can be helpful in drastically improving the performance of the application.

  • Testing: At this stage you should conduct functional and non-functional testing for the modules that have been successfully migrated.

The complete life cycle of the migration process ensures a smooth migration of your system from ASP to ASP.NET


please check this for MIGRATION OF ASP TO ASP.NET

Contents

http://msdn.microsoft.com/en-us/library/aa479019.aspx#aspnetmigrissues_intro 
http://msdn.microsoft.com/en-us/library/aa479019.aspx#aspnetmigrissues_compatibility 
http://msdn.microsoft.com/en-us/library/aa479019.aspx#aspnetmigrissues_core 
http://msdn.microsoft.com/en-us/library/aa479019.aspx#aspnetmigrissues_structural 
http://msdn.microsoft.com/en-us/library/aa479019.aspx#aspnetmigrissues_visualbasic 
http://msdn.microsoft.com/en-us/library/aa479019.aspx#aspnetmigrissues_com 
http://msdn.microsoft.com/en-us/library/aa479019.aspx#aspnetmigrissues_application 
http://msdn.microsoft.com/en-us/library/aa479019.aspx#aspnetmigrissues_state 
http://msdn.microsoft.com/en-us/library/aa479019.aspx#aspnetmigrissues_security 
http://msdn.microsoft.com/en-us/library/aa479019.aspx#aspnetmigrissues_data 
http://msdn.microsoft.com/en-us/library/aa479019.aspx#aspnetmigrissues_preparation 
http://msdn.microsoft.com/en-us/library/aa479019.aspx#aspnetmigrissues_summary

Please refer this link 

http://msdn.microsoft.com/en-us/library/dddsc60w(v=vs.71).aspx

  Vickey F replied to Shiv Kant Pandey
19-May-11 04:11 AM
ASP and ASP.NET can run side by side on an Internet Information Services (IIS) Web server without interference; there is no chance of corrupting an existing ASP application simply by installing ASP.NET. Only files with an .aspx file name extension are processed by ASP.NET; files with an .asp file name extension will continue to be processed by the existing, unchanged ASP engine. You should note, however, that session state and application state are not shared between ASP and ASP.NET pages.

follow this-

http://msdn.microsoft.com/en-us/library/dddsc60w%28v=vs.71%29.aspx
Create New Account
help
components What are the new " components " in dot net 2.0? Hi, The list of .NET 2.0 and C# 2.0 new features is extracted from the appendix of the features are thoroughly covered in the book. Contents Assembly Application localization Application build process Application configuration Application deployment CLR Delegate Threading / Synchronization Security Reflection / Attribute Interoperability C# 2.0 Exceptions Collections Debugging Base classes IO Windows Forms 2.0 ADO.NET 2.0 ADO.NET 2.0 SQL Server data provider (SqlClient) XML .NET Remoting ASP.NET 2.0 Web Services Assembly The use
Migrating to Visual Studio.NET 2003: A Developer Perspective Migrating to Visual Studio.Net 2003: A Developer - oriented analysis By Peter A. Bromberg, Ph.D. Printer - Friendly Version Peter Bromberg A new Platform On April 24, 2003 Microsoft Windows Server 2003 and Visual Studio .NET 2003 are officially released. Many developers and beta testers (myself
REVIEW: Visual Studio.NET 2003 [BETA 1] Review: Visual Sudio.NET 2003 [Beta 1] By Peter A. Bromberg, Ph.D. Printer - Friendly Version Peter Bromberg Yesterday and proceeded to install the 8 - CD package on one of my test partitions running .NET Server Enterprise. The good news is that if you leave out Crystal Reports, the MSDE and more good content, comes on three of the CD's in the package. Visio and Visual Sourcesafe come on the remaining two CD's. Installation - Good News! Installation of Visual Studio
Frequently asked Interview Questions in ADO.Net hi friends Any one send frequently asked Important questions in C# .Net, ADO .Net, Asp .Net and Sql Server. . . . . . . . tx in Advance. . . . . . Hi, Find this. . (B)What is an IL? (B)What is a B) What is concept of Boxing and Unboxing ? (B) What is the difference between VB.NET and C#? (I) what is the difference between System exceptions and Application exceptions? (I)What is CODE Access security? (I)What is a satellite assembly? (A) How to prevent my .NET DLL to be decompiled? (I) what is the difference between Convert.toString and .toString () method
Interview Questions for .NET Framework This article is specially for the users those are in development or want to be a .net developer • To test a Web Service you must create a windows application or web application to consume this service? It is True / False? FALSE How many classes can a single.NET DLL contain? Answer1: As many Answer2: One or more What are good ADO.NET object(s) to replace the ADO Recordset object? The differences includes In ADO, the in memory representation of data is the recordset. In ADO.net, it is the dataset A recordset looks like a single table in ADO In contrast, a dataset is a collection of one or more tables in ADO.net ADO is designed primarily for connected access ADO.net the disconnected access to the database