ASP.NET is a server-side web technology developed by Microsoft to build dynamic, interactive and database-driven web applications. ASP.NET is a subset of Microsoft.NET framework. ASP.NET is the successor version to classic ASP(Active Server Pages). ASP.NET is a mix of HTML and Server-side scripting to generate dynamic and interactive web pages and applications.
ASP.NET is a technology, which works on the .Net framework that contains all web-related functionalities. The .Net framework is made of an object-oriented hierarchy. An ASP.NET web application is made of pages. When a user requests an ASP.NET page, the IIS delegates the processing of the page to the ASP.NET runtime system.
The ASP.NET application codes can be written in any of the following languages:
- Visual Basic.Net
ASP.NET Web Forms Model
ASP.NET web forms extend the event-driven model of interaction to the web applications. The browser submits a web form to the web server and the server returns a full markup page or HTML page in response.
All client side user activities are forwarded to the server for stateful processing. The server processes the output of the client actions and triggers the reactions.
HTTP is a stateless protocol. ASP.NET framework helps in storing the information regarding the state of the application, which consists of Page state and Session state.
Page state and Session state will be discuss later in this tutorial.
Disadvantages of ASP
- Poor Re-usability – ASP pages are interpreted and executed on the Web server, line-by-line, from top to bottom. Each page is therefore written in a sequential manner to meet specific objectives, which makes it difficult to re-use the page in another ASP application.
- Supports only scripting languages – Scripting languages are limited in functionality when compared to programming languages. Most developers who have worked with programming languages wish to use the full functionality of a programming language to develop complex Web applications. Moreover, scripting languages are interpreted and not compiled. This affects performance as the ASP scripts must be parsed and executed every time a request is made.
- No separation of code and presentation – Scripts in ASP pages are mixed with the HTML code and executed in-line with it. This makes it very difficult to read and understand an ASP application written by somebody else. So, project development, involving multiple team members and project maintenance are both made difficult.
- Poor support for state management – ASP does not provide built-in support for retaining the state of HTML forms. Developers have to write additional code to save the data entered by users in form fields during post-backs and restore the data in the form before returning the form to the users.
- Poor support for multiple browsers – Different browsers support ASP to different extents. In order to support multiple browsers, developers have to explicitly write different versions of the code.
- Platform-dependence – ASP is limited to the Windows platform though there are some versions of ASP available for other platforms also. This factor restricts the reach of Web applications on the Internet.
ASP.NET attempts to overcome these drawbacks and makes the web applications easy and efficient
Advantages of ASP.NET
- Support for .NET Framework – ASP.NET is a part of the .NET Framework. The .NET Framework provides almost 13,000 classes that can be used in ASP.NET pages.
- Support for programming languages.
- Platform Independent.
- Support for separation of code and presentation.
- Web services.
- Client platform Independence.
Note: By default, files with the extension, .asp are mapped by IIS to asp.dll and files with the extension .aspx are mapped to aspnet_isapi.dll.
Characteristics of ASP.NET
- ASP.NET Web Forms Pages
- ASP.NET Controls
- Cross-Language Support.
- Event-Driven Programming Model
- Data Access: ASP.NET supports ADO.NET provided by the .NET Framework.
- Session State Management
- Deployment: ASP.NET applications can be deployed by simply copying the files to the appropriate directory on the Web server.
- Error handling, Debugging, and Tracing.
- Security Management: To secure an ASP.NET application, you must perform the three fundamental functions, authentication, authorization, and impersonation.
o Authentication: such as name and password are validated.
o Authorization: It limits access rights by granting or denying specific permissions to an authenticated identity.
o Impersonation: It enables the ASP.NET application to execute in the context of an authenticated or anonymous user when the request is passed to the application from IIS. Access is then granted or denied based on the impersonated identity.