ASP.NET

0
357
aspnet

What is ASP.NET?

ASP.NET is one of the most secure platform for developing web application and desktop application. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft’s Active Server Pages (ASP) technology. 4.6 is the latest official version.

ASP.NET is a web application framework developed by Microsoft to allow programmers to build dynamic websites. It uses C# and VB.NET to built application easily. It works on top of the HTTP protocol, and uses the HTTP commands and policies to set a browser-to-server bilateral communication and cooperation. It provides high-level entities such as classes and components within an object-oriented paradigm. MVC (Model-controller-view) framework is used.

ASP.NET is used to produce interactive, data-driven web applications. It consists of a large number of controls such as text boxes, buttons, and labels for assembling, configuring, and manipulating code to create HTML pages.

Working of ASP.NET

ASP web forms extend the event-driven model of interaction. The browser submits the data to web server and the server returns html page in response.

The client side activities are forwarded to the server for processing. The server processes all the client activities and triggers reaction.

There are two state

  • Page State
  • Session State

Page state is the content of the various input fields in the client side which is not sent to the browser. Session state is the collective information obtained from the various pages the user visited and worked with.

The page state is the state of the client, i.e., the content of various input fields in the web form. The session state is the collective information obtained from various pages the user visited and worked with, i.e., the overall session state.

For Example

Lets take login and registration example. When a user registers in a website he/she sends details through input fields. Same with the login when a user enters username and password it sends the request to the server and redirects to the users dedicated page. HTTP alone cannot track all the information coming from the page. So the ASP session state keeps the track of the information and keeps in the session until the user logout.

ASP.NET Components model

The ASP.NET component model provides various building blocks of ASP.NET pages. Basically it is an object model, which describes:

  • Server side counterparts of almost all HTML elements or tags, such as <form> and <input>.
  • Server controls, which help in developing complex user-interface.

ASP.NET is a technology, which works on the .Net framework that contains all web-related functionalities. The .Net framework has an object-oriented hierarchy. The ASP.NET runtime transforms the .aspx page into a class instance, which is inherited from the base class of the .net framework. ASP.NET pages are object and all its components are also objects.

Installing ASP.NET

Microsoft provides a free version of visual studio which also contains SQL Server and it can be downloaded from www.visualstudio.com. After that install the setup of Visual Studio, once installed open the program and select new project from File → New → Project. Then select the template you want and also the language C# or VB, either one.

When you start a new website ASP.NET provides files and folders. The first file is default.aspx.cs for C# and default.aspx.vb for VB. IT also contains default.aspx which contains HTML code and asp code that defines forms.

A typical ASP.NET application consists of many items: the web content files (.aspx), source files (.cs files or .vb files), assemblies (.dll and .exe files), data source files (.mdb files), references, icons, user controls and miscellaneous other files and folders.

Typically a project contains the following content files:

  • Page file (.aspx)
  • User control (.ascx)
  • Web service (.asmx)
  • Master page (.master)
  • Site map (.sitemap)
  • Website configuration file (.config)

You can execute an application by:

  • Selecting Start
  • Selecting Start Without Debugging from the Debug menu,
  • pressing F5
  • Ctrl-F5

For examples use this site.