ASP.NET Introduction
why ASP.NET?

For this answer we have to looking back. What was running before ASP .NET.
ASP was running . So what is ASP?
ASP (Active Server Pages):-
  • ASP stands for Active Server Pages
  • ASP is a Microsoft Technology
  • ASP is a program that runs inside IIS
  • IIS stands for Internet Information Services
  • IIS comes as a free component with Windows 2000
  • IIS is also a part of the Windows NT 4.0 Option Pack
  • The Option Pack can be downloaded from Microsoft
  • PWS is a smaller - but fully functional - version of IIS
  • PWS can be found on your Windows 95/98 CD

In definition:-

Microsoft Active Server Pages (ASP) is a server-side scripting technology. ASP is a technology that Microsoft created to ease the development of interactive Web applications.

With ASP you can use client-side scripts as well as server-side scripts. Maybe you want to validate user input or access a database. ASP provides solutions for transaction processing and managing session state.

Asp is one of the most successful language used in web development.

What are demerits of old ASP:- There are lots of demerits with old ASP:-
  1. Interpreted and Loosely-Typed Code:- ASP scripting code is usually written in languages such as JScript or VBScript. The script-execution engine that Active Server Pages relies on interprets code line by line, every time the page is called.

    In addition, although variables are supported, they are all loosely typed as variants and bound to particular types only when the code is run. Both these factors impede performance, and late binding of types makes it harder to catch errors when you are writing code.
  2. Limited Development and Debugging Tools:-Microsoft Visual InterDev, Macromedia Visual UltraDev, and other tools have attempted to increase the productivity of ASP programmers by providing graphical development environments. However, these tools never achieved the ease of use or the level of acceptance achieved by Microsoft Windows application development tools, such as Visual Basic or Microsoft Access. ASP developers still rely heavily or exclusively on Notepad.

    Debugging is an unavoidable part of any software development process, and the debugging tools for ASP have been minimal. Most ASP programmers resort to embedding temporary Response. Write statements in their code to trace the progress of its execution.
  3. Mixes layout (HTML) and logic (scripting code):-ASP files frequently combine script code with HTML. This results in ASP scripts that are lengthy, difficult to read, and switch frequently between code and HTML. The interspersion of HTML with ASP code is particularly problematic for larger web applications, where content must be kept separate from business logic.
  4. Update files only when server is down:-If your Web application makes use of components, copying new files to your application should only be done when the Web server is stopped. Otherwise it is like pulling the rug from under your application's feet, because the components may be in use (and locked) and must be registered.
  5. Obscure Configuration Settings:_The configuration information for an ASP web application (such as session state and server timeouts) is stored in the IIS metabase. Because the metabase is stored in a proprietary format, it can only be modified on the server machine with utilities such as the Internet Service Manager. With limited support for programmatically manipulating or extracting these settings, it is often an arduous task to port an ASP application from one server to another.
  6. Lack of state management:-Session state is only maintained if the client browser supports cookies. Session state information can only be held by using the ASP Session object. And you have to implement additional code if you, for example, want to identify a user.


So, solving of ASP problems or demerits a language developed is called ASP.NET. So what is ASP.NET
What is ASP.NET?

ASP.NET is a specification developed by Microsoft to create dynamic Web applications, Web sites, and Web services. It is a part of .NET Framework. You can create ASP.NET applications in most of the .NET compatible languages, such as Visual Basic, C#, and J#.

The ASP.NET compiles the Web pages and provides much better performance than scripting languages, such as VBScript. The Web Forms support to create powerful forms-based Web pages. You can use ASP.NET Web server controls to create interactive Web applications. With the help of Web server controls, you can easily create a Web application.


Advantages of ASP.NET
  1. Productivity:-You can easily and quickly create ASP.NET Web pages and applications using new ASP.NET server controls and existing controls with new features. New areas such as membership, personalization, and themes provide system-level functionality that would normally require extensive developer coding. Core development scenarios, particularly data, have been addressed by new data controls, no-code binding, and smart data-display controls.
  2. Flexibility and extensibility:- Many ASP.NET features are extensible so that you can easily incorporate custom features into applications.

    The ASP.NET provider model, for example, provides pluggable support for different data sources.
  3. Separation of Code from HTML:- To make a clean sweep, with ASP.NET you have the ability to completely separate layout and business logic. This makes it much easier for teams of programmers and designers to collaborate efficiently. This makes it much easier for teams of programmers and designers to collaborate efficiently.
  4. Support for compiled languages:- Developer can use VB.NET and access features such as strong typing and object-oriented programming. Using compiled languages also means that ASP.NET pages do not suffer the performance penalties associated with interpreted code. ASP.NET pages are precompiled to byte-code and Just In Time (JIT) compiled when first requested. Subsequent requests are directed to the fully compiled code, which is cached until the source changes.
  5. Performance:- Features such as precompilation, configurable caching, and SQL cache invalidation allow you to optimize the performance of your Web applications.
  6. Graphical Development Environment:- Visual Studio .NET provides a very rich development environment for Web developers. You can drag and drop controls and set properties the way you do in Visual Basic 6. And you have full IntelliSense support, not only for your code, but also for HTML and XML.
  7. Use services provided by the .NET Framework:- The .NET Framework provides class libraries that can be used by your application. Some of the key classes help you with input/output, access to operating system services, data access, or even debugging. We will go into more detail on some of them in this module
  8. State management:- To refer to the problems mentioned before, ASP.NET provides solutions for session and application state management.

    State information can, for example, be kept in memory or stored in a database. It can be shared across Web farms, and state information can be recovered, even if the server fails or the connection breaks down.
  9. Security:- It is now easier than ever to add authentication and authorization to your Web applications.
  10. Hosting:- ASP.NET includes new features that make it easier to manage a hosting environment and create more opportunities for hosters to add value.
  11. Update files while the server is running:- Components of your application can be updated while the server is online and clients are connected.

    The Framework will use the new files as soon as they are copied to the application. Removed or old files that are still in use are kept in memory until the clients have finished.
  12. XML-Based Configuration Files:- Configuration settings in ASP.NET are stored in XML files that you can easily read and edit. You can also easily copy these to another server, along with the other files that comprise your application.
  13. Completeness:- New and existing features work in concert to allow you to create end-to-end scenarios that address real-world Web development challenges.


ASP.NET Architecture
ASP.NET is based on the fundamental architecture of .NET Framework. Visual studio provide a uniform way to combine the various features of this Architecture.


  • CLR:- At the bottom of the Architecture is Common Language Runtime. NET Framework common language runtime resides on top of the operating system services. The common language runtime loads and executes code that targets the runtime. This code is therefore called managed code. The runtime gives you, for example, the ability for cross-language integration.
  • Basic Library:-.NET Framework provides a rich set of class libraries. These include base classes, like networking and input/output classes, a data class library for data access, and classes for use by programming tools, such as debugging services. All of them are brought together by the Services Framework, which sits on top of the common language runtime.
  • ADO.NET:- ADO.NET is Microsoft’s ActiveX Data Object (ADO) model for the .NET Framework. ADO.NET is not simply the migration of the popular ADO model to the managed environment but a completely new paradigm for data access and manipulation.

    ADO.NET is intended specifically for developing web applications. This is evident from its two major design principles:
    1. Disconnected Datasets:-In ADO.NET, almost all data manipulation is done outside the context of an open database connection.
    2. Effortless Data Exchange with XML:-Datasets can converse in the universal data format of the Web, namely XML.


  • Windows & ASP.NET:-The 4th layer of the framework consists of the Windows application model and, in parallel, the Web application model. The Web application model-in the slide presented as ASP.NET-includes Web Forms and Web Services. ASP.NET comes with built-in Web Forms controls, which are responsible for generating the user interface.

    They mirror typical HTML widgets like text boxes or buttons. If these controls do not fit your needs, you are free to create your own user controls. Web Services brings you a model to bind different applications over the Internet. This model is based on existing infrastructure and applications and is therefore standard-based, simple, and adaptable. Web Services are software solutions delivered via Internet to any device.

    Today, that means Web browsers on computers, for the most part, but the device-agnostic design of .NET will eliminate this limitation.

  • CLS:-One of the obvious themes of .NET is unification and interoperability between various programming languages.

    In order to achieve this; certain rules must be laid and all the languages must follow these rules. In other words we can not have languages running around creating their own extensions and their own fancy new data types. CLS is the collection of the rules and constraints that every language (that seeks to achieve .NET compatibility) must follow.
  • Many technologies:-The CLR and the .NET Frameworks in general, however, are designed in such a way that code written in one language can not only seamlessly be used by another language. Hence ASP.NET can be programmed in any of the .NET compatible language whether it is VB.NET, C#, Managed C++ or JScript.NET.