ASP.NET Tutorial

.NET Framework

ASP.NET Introduction

ASP.NET Web Forms

Standard Controls

Label Control

TextBox Control

Image Control

Button Controls

Redirecting User

Using HyperLinks

RadioButton Control

RadioButtonList

CheckBox Control

CheckBoxList Control

DropDownList

ListBox Control

ImageMap Control

Event-Driven Programming

ASP.NET Page Structure

IsPostBack

Master Page

View State

Visibility of Controls

Formatting Controls

Applying CSS

Dynamic CSS

Using Style Class

Themes and Skins

Panel Control

PlaceHolder Control

AdRotator Control

Calendar Control

File Upload, Virtual Path

Validation Controls

Page Navigation

User Control

Separating Code-Presentation

Overview of ADO.NET

Data Binding

DataBinding List Control

Define ASP.NET

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:

  • C#.Net
  • Visual Basic.Net
  • JScript.NET
  • J#.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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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

  1. 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.
  2. Support for programming languages.
  3. Platform Independent.
  4. Support for separation of code and presentation.
  5. Web services.
  6. 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

  1. ASP.NET Web Forms Pages
  2. ASP.NET Controls
  3. Cross-Language Support.
  4. Event-Driven Programming Model
  5. Data Access: ASP.NET supports ADO.NET provided by the .NET Framework.
  6. Session State Management
  7. Deployment: ASP.NET applications can be deployed by simply copying the files to the appropriate directory on the Web server.
  8. Error handling, Debugging, and Tracing.
  9. 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.
  10. Caching