Difference Between ASP and ASPX
Key difference: .asp is the filename for a page designed by ASP. ASP stands for Active Server Pages. It is commonly known as Classic ASP or ASP Classic. It is a server-side scripting environment that is developed and released by Microsoft. .aspx is the filename for a page designed by ASP.NET. ASP.NET is a server-side Web application framework. ASPX stands for Active Server Pages Extended. It was designed for Web development to produce dynamic Web pages.
.asp is the filename for a page designed by ASP. ASP stands for Active Server Pages. It is commonly known as Classic ASP or ASP Classic. It is a server-side scripting environment that is developed and released by Microsoft. It was Microsoft's first server-side script engine for dynamically generated web pages. ASP was originally released as part of the Windows NT 4.0 Option Pack. It was meant to be an add-on to Internet Information Services (IIS). Since, then ASP has been superseded by ASP.NET, another product by Microsoft.
ASP is mainly used to create and run dynamic, interactive Web server applications. It also allows one to combine HTML pages, script commands, and COM components to create interactive Web pages and powerful Web-based applications. It also makes it easier to develop and modify the said Web applications.
After its original release, there have been two version releases. The ASP 2.0 introduced six built-in objects to the original, which were Application, ASPError, Request, Response, Server, and Session. ASP 3.0 introduced some additional enhancements such as Server.Transfer method, Server.Execute method, and an enhanced ASPError object. Additionally, ASP 3.0 also enabled buffering by default and optimized the engine for better performance. However, as of May 2013 there are no planned upgrades to ASP.
.aspx is the filename for a page designed by ASP.NET. ASP.NET is a server-side Web application framework. ASPX stands for Active Server Pages Extended. It was designed for Web development to produce dynamic Web pages. It is actually the successor to Microsoft's ASP. It was released in January 2002 with the .NET Framework. It is mainly used to build dynamic web sites, web applications and web services.
ASP.NET is built on the Common Language Runtime (CLR). This allows programmers to write ASP.NET code using any supported .NET language. ASP.NET Web pages are also commonly known as Web Forms. They contain static (X)HTML markup. It also contains markup that defines server-side Web Controls and User Controls. This is where developers place all the rc content for the Web page.
In ASP.NET Framework 2.0, a new code-behind model was introduces. This allows static text to remain on the .aspx page, while dynamic code remains in an .aspx.vb or .aspx.cs or .aspx.fs file. The location of the dynamic code depends on the programming language used.
Some differences between ASP and ASPX:
- ASP runs on IIS. ASPX runs on .Net framework.
- ASP uses VBScript for its code. ASP.NET allows the use of C#, VB.NET and other languages.
- ASP.NET gives access to all the tools which come with the .NET framework and allows one to write object-oriented code.
- ASP.NET offers the ability to build pages composed of controls similar to a Windows user interface.
- ASP.NET offers the programmer the ability to develop applications using an event-driven GUI model, whereas ASP offers conventional Web-scripting environments.
- ASP.NET has compiled code, which means that applications run faster with more design-time errors trapped at the development stage.
- ASP.NET has significantly improved run-time error handling, making use of exception handling using try-catch blocks.
- ASP.NET has an extensive set of controls and class libraries, as well as user-defined controls.
- ASP.NET has the ability to cache the whole page or just parts of it to improve performance.
- ASP.NET has the ability to use the code-behind development model to separate business logic from presentation.
- ASP.NET has the ability to use true object-oriented design for programming pages and controls.
- In ASP.NET, session state can be saved in a Microsoft SQL Server database or in a separate process running on the same machine as the Web server or on a different machine.
- ASP.NET introduces Web Server Controls for providing the UI for the Web form. These controls are state managed controls and are WYSIWYG controls.
- ASP engine executes server-side code, which is always through an interpreter (JScript or VBScript). ASP.NET pages are always compiled into .NET classes housed within assemblies.
- In classic ASP it was very difficult to debug the application. In ASP.NET, pages that are compiled into classes can be debugged using the same debugging tools available to desktop applications or component developers.
- ASP is interpreted, ASP.NET is compiled.
- Classic ASP uses a technology called ADO to connect and work with databases. ASP.NET uses the ADO.NET technology
- ASP has Mixed HTML and coding logic where in ASP.NET html and coding part are separated by code behind files.
- ASP.NET is purely object-oriented whereas ASP is partially object-oriented.
- There is no in-built support for XML in ASP, whereas ASP.NET has full XML support for easy data exchange.
Image Courtesy: planet-source-code.com, johnwilliams92.info