Presentation is loading. Please wait.

Presentation is loading. Please wait.

ASP.NET application. Roadmap ASP.NET file types Bin directory Application updates Simple application from start to finish using a virtual directory Behind.

Similar presentations


Presentation on theme: "ASP.NET application. Roadmap ASP.NET file types Bin directory Application updates Simple application from start to finish using a virtual directory Behind."— Presentation transcript:

1 ASP.NET application

2 Roadmap ASP.NET file types Bin directory Application updates Simple application from start to finish using a virtual directory Behind the scenes Code Behind Web Form Inheritance Importing namespaces 2www.tech.findforinfo.com

3 ASP.NET file types File Name Description.aspx ASP.NET web pages User Interface and underlying code.ascx ASP.NET user controls,used to create custom controls Inherited to a web page Web.config XML-based configuration files,which hold settings for application.cs,.vb Code behind files,allows to create separate code Global.asax File is used to declare global variables and react to global events.asmx Web services 3www.tech.findforinfo.com

4 The bin directory Every application has a sub directory called as bin It holds the.NET assemblies used by your application To say in simple it holds the compiled version of the code Eg database component 4www.tech.findforinfo.com

5 Application updates ASP.NET application easily and painlessly modified without the need of restarting the server Page updates If the code is modified in a page,ASP.NET automatically recompiles an updated version with the next client request and uses caching to improve performance 5www.tech.findforinfo.com

6 Component updates The assemblies in the bin directory can be easily replaced ASP.NET continuously monitors the bin directory and creates a new application domain and uses it for the new requests 6www.tech.findforinfo.com

7 Configuration changes The configuration of a web application is defined in the web.config file The web.config file holds the information in the XML format Once again the new changes are managed by the new application domain Easy and editable medium and the changes are rolled back easily 7www.tech.findforinfo.com

8 Simple application from start to finish Create Virtual directory C:\ASP.NET\TestWeb Go to Control panel->Administrative tools -> IIS- >Default Web Site Right click and select New virtual directory 8www.tech.findforinfo.com

9 Continue the wizard 9www.tech.findforinfo.com

10 Give the alias name as MyFirstWebApp 10www.tech.findforinfo.com

11 Create a simple code Public Sub Page_Load() lbltest.Text="Helo" End Sub 11www.tech.findforinfo.com

12 Line by Line with the code It consists of two blocks Script –holds the code Form – holds the asp server controls When creating server controls always it is necessary to use runat=“server” attribute,it specifies the control is based on the server 12www.tech.findforinfo.com

13 Behind the scenes ASP.NET Web request IIS Handle the request Is the file reg to ASP.NET NO Start the application Yes Is the application started Compile the page Instantiate the page events Render to HTML one control at a time Web response Yes Is the page compiled 13www.tech.findforinfo.com

14 How to run Open the explorer Type http://computername/Virtual directory name/formname.aspxhttp://computername/Virtual 14www.tech.findforinfo.com

15 Code Behind Create separate code file(.vb file for VB.NET or.cs file for C#.NET) The.aspx file contains the UI and series of HTML code with ASP.NET tags The.vb or.cs file contains only code(Logic) <%@ Page Language=“VB” Inherits =“MyPageClass” Src=“MyPageClass.cs” Identifies the classIdentifies source file 15www.tech.findforinfo.com

16 The MyPageClass.cs file It consists of a class file Public Class MyPageClass Inherits System.Web.UI.Page ‘Code goes here’ End Class 16www.tech.findforinfo.com

17 Inheritance explained 17www.tech.findforinfo.com

18 Inheritance explained 18www.tech.findforinfo.com

19 Web form inheritance Custom.aspx file Custom page Class (.cs) Page object Generic page class System.Web.UI.namespace 19www.tech.findforinfo.com

20 Three levels of inheritance Step 1 Generic Page class Library available in the.NET library with the basic functionality Step2 The code behind file(.vb or.cs file) inherits from the Page class to accquire the basic set of ASP.NET web page 20www.tech.findforinfo.com

21 Three levels of inheritance Step 3 Finally the.aspx file inherits the code from the code behind file to combine the user interface with the code 21www.tech.findforinfo.com

22 Importing namespaces The namespaces can be added into the code using “imports” keyword in vb” “using” keyword in C# Alternative way is to add in directives Imports System.Data.Oledb 22www.tech.findforinfo.com

23 Accessing Code Behind Better Organization Often ASP.NET is combined with html and asp code The code behind provides a neat encapsulation of the code in a class Separation of User Interface It designed by any third party tools like Microsoft Frontpage or Macromedia Dreamweaver The ability to use advanced code editors Notepad Visual Studio.Net editor (Intellisense provides automatic statement completion) 23www.tech.findforinfo.com

24 Three ways to Code Web Form Development Type You CreateYou Deploy (to the server) Traditional inline code.aspx.aspx file Code Behind.aspx files with.vb code. aspx and.vb files Compiled Code Behind.aspx files with.vb code.aspx files and the compiled.dll files 24www.tech.findforinfo.com


Download ppt "ASP.NET application. Roadmap ASP.NET file types Bin directory Application updates Simple application from start to finish using a virtual directory Behind."

Similar presentations


Ads by Google