Home | HTML | Asp.Net | HTML Probe | .Net Probe
  Contact Us |Sitemap

Introduction of Asp.Net

 Skip Navigation LinksHome>Asp Home>Asp Introduction
Role of ASP.NET in the .NET Framework:

ASP.NET is a part of the Microsoft .Net Framework. Some ASP.NET Web Application elements are:
  1. Web Form Page: It contains .aspx extension and corresponding class. Web form page used many controls like Textbox control, Button control, Image control etc.

  2. Configuration file: It enables you to store the configuration setting of an Asp.Net Web application.

  3. XML Web Service File: Defines a web service that can be called by an aspx file over the internet or from a local network.

Web Application:

Web applications are programs that are executed on a web server and accessed from a web Browser. These applications are used to share and access information on the internet and can be accessed from anywhere, anytime. These applications are also used for E-Commerce(online commercial transactions).

There are two types of Web Pages i.e.
  • Static Web Page: A static page cannot change by user dynamically at run time.

  • Dynamic Web Page: User can change dynamic web page at run time.
Two types of scripts are used to create a web application.
  • Server-Side Script: Server Side Scripting provides user with dynamic content that is based on the information stored at a remote location such as a backend database. The code for server side script are written in server side scripting language such as ASP(Active Server Page) & JSP(Java Server Page).
    Example: Display current date time of Server.

  • Client-Side Scripting: A Client-Side Script runs on client machine. The code for client-side script are written in Client-Side Scripting language such as Java Script & VB Script.

Working process of Asp.Net web application:

Step1- First of all a web browser sends a .aspx request to Web Server such as IIS by using URL(uniform resource locator).

Step2- Web server receives .aspx request to load the page and send it to asp.net script engine for processing.

Step3- .aspx request is received for processing and a html page is generated. Html page is send t web server by the asp.net runtime script engine.

Step4- Web server receive HTML page and sent it to the browser.

Step5- Web browser receive HTML page and response html page as a user request .aspx page.

Directories used in asp.net web application:

  • Bin: Stores all the compiled .net component (DLL) which is used by ASP.NET web application. This directory contains compiled assemblies.
  • App_Code: It stores source code file that are dynamically compiled to be used in the web application.

  • App_Browsers: Stores browser definition file such as XML file.

  • App_GlobalResources: It stores global resources that can be accessed from every page in the web application. It is used gor localization purpose.

  • App_LocalResources: It stores .resx file that is accessible to specify page.

  • App_WebReference: It stores Web Services reference.

  • App_Data: Stores data file such as database file or XML file.

  • App_Themes: Stores the themes.

Files used in asp.net application:

  • .aspx extension: It is asp.net web page and this page is used to start a web application.

  • .asmx extension: It is asp.net web services. Web services are a collections of methods that can be called over the internet.

  • .cs extension: It is a code behind file that contains C# Code for a web application.

  • .ascx extension: It is a asp.net user controls. User controls can be used at any page in a web application.

  • Web.config file: It is a XML based configuration file.

  • .ashx extension: These are default HTTP handlers.

  • Global.asax: It is a global application file. It is commonly used for to define application and session object.
ASP.NET Web page code model:

There are two type of page model:
  1. Single-file page model:- Single-file page model contains the HTML and C#/VB code in the same page. The first line in the .aspx file contains the @page directive. Syntax of page directive is:-

    <%@ Page Language="C#"%>.

  2. Code-Behind Page Model:- In the page behind page model, HTML code is kept in 1 file with .aspx file extension and programming code in another file with .cs/.vb file extension. Syntax of @page directive is:-

    <%@ Page Language ="C#" CodeFile="Default.aspx.cs" Inherits="_Default"%>.
The Page class:

All the page class is define in the System.Web.UI namespace.
There are three types of Page event.
  • Init: It is the first event that occurs when the server executes an ASP.NET page. It occour only once in the entire lifecycle of an ASP.NET page.

  • Load Load event is fired after the Init event, when the page is requested for the first time or reloaded. This event can be used to initialize the variables and the state of the controls that are used in the page.

  • Unload: It is the last event in the ASP.NET Page. This event is used to perform final cleanup work such as closing file or closing open database connection etc.

Creating a Simple Website:

  1. Create a new Web site by selecting File → New → Web Site within Visual Studio, With the location File System/HTTP/FTP. You can choose your programming language as Visual C# or Visual Basic.
  • File System: When the location is selected as file system,the files are stored in the local computer’s file system or in a shared network folder. There is no need to install IIS on the computer. The asp.net development server acts as a web server for the file system website. A website installed on file system can not be accessed from a remote location.

  • HTTP: When the location is selected as HTTP, visual studio automatically creates the website in an IIS virtual directory. So there is no need to create the virtual directory in IIS. Choosing HTTP means that IIS is used and a virtual directory is created. Using HTTP location, the site is accessible from other computer.

  • FTP: When the location is selected as FTP,the files are stored on a remote server. An FTP site can test on the server where it will actually be deployed. The drawback of FTP site is you do not have local copies of file unless you copy them yourself.
  1. After creating the Web site, the file default.aspx is opened in the editor. One part shows the Source View, while the other shows the Design View.

  2. Add a new page by selecting websiteAdd New Item.
  1. A table is useful for arranging the controls. Click into the Design View and add a table by selecting TableInsert Table. In the Insert Table dialog, set the property of table, as shown in Figure.
  1. Start the Web application by selecting DebugStart Debugging.
DMCA.com Protection Status
Design & Maintain By solvingera group| solvingera.com © 2013-2014 | all right reserved |Privacy Policy | Back to top