ASP vs ASP.NET. Know the difference

Facebook
Twitter
LinkedIn

Never miss a post!

Sign up for our newsletter and get FREE Development Trends delivered directly to your inbox.

You can unsubscribe any time. Terms & Conditions.
Categories

ASP and ASP.NET are the two known widely used languages to develop web pages. These are great to build websites and web applications. Typically, legacy applications were developed in classic ASP using VBScript and MS Access database as the backend data source. Microsoft Corporation has done tremendous efforts to migrate applications from classic ASP to ASP.NET and MS Access Database to MS SQL Server.

History

ASP

ASP or Active Server Page is the first web technology released by Microsoft in 1996. It was released as a part of IIS (Internet Information Manager) 3.0.  Later, two more versions were released named as 2.0 and 3.0. ASP 3.0 has major advancements like better performance and buffering, transfer and server execute methods.

ASP.NET

ASP.NET is the successor to classic ASP language. IIS 6.0 supports it and it allows developer to create application, websites and we services using .NET framework. It is built on Common Language Runtime.

Compilation and Interpretation

ASP

In ASP, the requested web page is parsed linearly; all the server side code is interpreted and rendered back as a response using VBScript or JavaScript to the calling client.  The lifecycle of this process execution makes it slower than ASP.NET.

ASP.NET

In contrast to the ASP, ASP.NET code is always compiled first into .NET classes of the assemblies. The class can contain the server side code and static HTML in it. All the requests are served by executing the compiled code, which is the reason it became popular as it eliminates the underlying inefficiencies of the classic ASP technology.

Language Support

ASP

ASP supports only two languages, VBScript and JavaScript. It allows different block of codes to be written in multiple scripting languages, which bring the slowness and performance degradation in the response time of an application. There is no separate design facility like code behind file. You cannot create custom controls in it.

ASP.NET

ASP.NET supports the languages of classic ASP. Furthermore, you can also use C# and VB.NET languages. It has a code-behind file that supports only one server side scripting language to be compiled and parsed by the framework. You can create custom controls by using @directive.

Object Oriented Programming and Database Transactions

ASP

In ASP, there is no concept of Object Oriented Programming. It has a simple COM object to support the functionality of accessing a database.

ASP.NET

You can implement the principles of Object Oriented Programming. It supports the XML integration from multiple data sources and has ADO.NET to read and write data into database.

IIS Process

ASP

You can only run ASP when you are running IIS as the application runs under the process of inetinfo.exe. If an IIS is crashed or paused, your ASP application will immediately stop working.

ASP.NET

ASP.NET runs under the process of distinct of IIS aspnet_wp.exe. If you stop the IIS, it will not affect the ASP.NET application and ensures the stability of your application.

Debugging

ASP

You cannot debug easily in ASP as it involves interpreting through JavaScript or VBScript.

ASP.NET

You can debug your code easily as there are many tools available in the .NET framework. In ASP.NET, C# and VB.NET, both are strong typed languages and will not be complied if there is any compilation error.

Example

Let us take an example of each technology, which will display the selected columns from the table company having ID 100 or above from external databases.

ASP

<!DOCTYPE html><html> <body> <!- - opening of server script tag --> <% set connect = Server.CreateObject( "ADODB.Connection" ) connect.Provider = "Microsoft.Jet.OLEDB.4.0" connect.Open( Server.Mappath ("/db/northwind.mdb") ) set rs = Server.CreateObject("ADODB.recordset") sql = "SELECT CompanyID, CompanyName, ContactName, RegistrationDate FROM Customers WHERE CompanyID > = 100" rs.Open sql, connect %> <!- - ending of server script tag --> <table border="1" width="100%"> <tr> <%for each x in rs.Fields response.write("<th>" & x.name & "</th>") next%> </tr> <!—print until reach end of file--> <%do until rs.EOF%> <tr> <%for each x in rs.Fields%> <td><%Response.Write(x.value)%> </td> <%next rs.MoveNext%> </tr> <%loop rs.close conn.close %> </table> </body> </html>

ASP.NET

<!- – opening of server script tag –>

@{

var db = Database.Open(“CustomersDB”);

var query = sql = “SELECT CompanyID, CompanyName, ContactName, RegistrationDate FROM Customers WHERE CompanyID  >= 100 “;

}<!- – ending of server script tag –>

 

<html>

<body>

<h1>Small Bakery Products</h1>

<table border=”1″ width=”100%”>

<tr>

<th>Id</th>

<th>Product</th>

<th>Description</th>

<th>Price</th>

</tr>

<!- – Iteration on results –>

@foreach(var row in db.Query(query))

{

<tr>

<td>@row.Id</td>

<td>@row.Name</td>

<td>@row.Description</td>

<td style=”text-align:right”>@row.Price</td>

</tr>

}

</table>

</body>

</html>

 

Facebook
Twitter
LinkedIn

Our website uses cookies that help it to function, allow us to analyze how you interact with it, and help us to improve its performance. By using our website you agree by our Terms and Conditions and Privacy Policy.