Introduction to ASP.NET What is ASP.NET and how is different from ASP –ASP: server side technology for creating dynamic web pages using scripting languages.

Slides:



Advertisements
Similar presentations
Introduction to .NET Framework
Advertisements

Tahir Nawaz Introduction to.NET Framework. .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a.
11 ASP.NET Slides based off:. 22 B ACKGROUND - W EB A RCHITECTURE Web Server PC/Mac/Unix/... + Browser Client Server Request:
Introduction to ASP.NET Some references: Beginning ASP.NET using VB.NET; Wrox; 2002 chpt 2. Kalata, K, Introduction to ASP.NET – 2002, chpt 1. Esposito,
Introduction to ASP.NET. 2 © UW Business School, University of Washington 2004 Outline Static vs. Dynamic Web Pages.NET Framework Installing ASP.NET First.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Introduction to ASP.NET What is.NET What is ASP.NET and how is different from ASP –ASP: server side technology for creating dynamic web pages using scripting.
Basics of ASP.NET. 2 © UW Business School, University of Washington 2004 Outline Installing ASP.NET and Web Matrix Data Types Branching Structure Procedures.
Introduction to ASP.NET What is.NET What is ASP.NET and how is different from ASP –ASP: server side technology for creating dynamic web pages using scripting.
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
Web-Based Applications
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Introduction to ASP.NET
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
1 Chapter 20 — Creating Web Projects Microsoft Visual Basic.NET, Introduction to Programming.
Introduction to VB.Net ITE-370. What is.NET? A brand of Microsoft technologies A platform for creating distributed Web applications A combination of new.
Intro to dot Net Dr. John Abraham UTPA – Fall 09 CSCI 3327.
ASP.NET
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 8: WebForms — Web-based.
Rajeswari Indupuri Introduction to.NET Framework.
A Free sample background from © 2001 By Default!Slide 1.NET Overview BY: Pinkesh Desai.
Introduction to ASP.NET
Introduction to.NET Content : – Introduction to.NET Technology – Introduction to Web Based Applications – Introduction to ASP.NET 1 By : Amrendra Sharan.
9-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion.
© 2004 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Programming the Web Using ASP.Net Chapter 2: The ASP.Net Template Dave.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Introduction to .Net Framework
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
ASP.NET INTRODUCTION INTO وزارة التربية و التعليم العالي كلية العلوم و التكنولوجيا قسم علوم الحاسوب و تكنولوجيا المعلومات اعداد الاستاذ: عبد الله محمد.
An Introduction to ASP.NET Ed Dunhill blogs.msdn.com/edunhill SLIDE7.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
ASP.NET The.NET Framework. The.NET Framework is Microsoft’s distributed run-time environment for creating, deploying, and using applications over the.
Introduction to.NET Framework. .NET – What Is It? Software platform Language neutral In other words:.NET is not a language (Runtime and a library for.
Microsoft Visual Basic 2005: Reloaded Second Edition
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
ASP.NET  ASP.NET is a web development platform, which provides a programming model, a comprehensive software infrastructure and various services required.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
Introduction to ASP.NET 1www.tech.findforinfo.com.
ASP.NET application. Roadmap ASP.NET file types Bin directory Application updates Simple application from start to finish using a virtual directory Behind.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Programming with Visual Web Developer Chapter 9.
The Web Architecture and ASP.NET. Slide 2 Review of the Web (1) It began with HTTP and HTML, which delivers static Web pages to browsers which would render.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
Introduction to VB.Net. What is.NET? A brand of Microsoft technologies A platform for creating distributed Web applications A combination of new and updated.
Rajiv and Shipra Introduction to.NET (asp.net,c#,vb)
Overview of Previous Lesson(s) Over View  SDI programs  The Application Wizard can generate single-document interface (SDI) applications that work.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
Module 1: Working with ASP.NET. Overview Introducing ASP.NET Creating Web Forms Adding ASP.NET Code to a Page Handling Page Events Discussion: ASP vs.
Compunet Corporation1 Programming with Visual Basic.NET Fundamentals of Programming Lecture # 1 Tariq Ibn Aziz.
Christopher M. Pascucci.NET Programming CodeBehind.
Intro to dot Net Dr. John Abraham UTPA CSCI 3327.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
PRIOR TO WEB SERVICES THE OTHER TECHNOLOGIES ARE:.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
Module 4: Creating a Web Application with Web Forms
Introduction to ASP.NET What is.NET What is ASP.NET and how is different from ASP –ASP: server side technology for creating dynamic web pages using scripting.
ISYS 512 Business Application Design and Development with.Net David Chao.
INTRODUCTION CHAPTER #1 Visual Basic.NET. VB.Net General features It is an object oriented language  In the past VB had objects but focus was not placed.
Text Introduction to.NET Framework. CONFIDENTIAL Agenda .NET Training – Purpose  What is.NET?  Why.NET?  Advantages  Architecture  Components: CLR,
Introduction to ASP.NET DESIGNED BY:- ER.ASHISH PANDEY (EXECUTIVE) (NEW HORIZON INDIA LTD)
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
1 Introducing Web Developer Tools Rapid application development tools ASP.NET-compatible web editors –Visual Studio.NET Professional Edition –Visual Studio.
A Detailed Introduction To Visual Studio.NET CRB Tech ReviewsCRB Tech Reviews introduces you to the world of Visual.
Introduction to the Microsoft.NET Framework Chris Wastchak Student Ambassador to Microsoft.
Introduction to ASP.NET
Introduction to .NET Framework Ch2 – Deitel’s Book
ASP.NET
Presentation transcript:

Introduction to ASP.NET What is ASP.NET and how is different from ASP –ASP: server side technology for creating dynamic web pages using scripting languages eg vb script. –ASP.NET: server side technology for creating dynamic web pages using Fully Fledged programming languages supported by.NET

What is.NET? A Microsoft strategy and new technology for delivering software services to the desktop and to the web Components include: – MS Intermediate Language; all code is complied into a more abstract, trimmed version before execution. All.NET languages are compiled to MSIL – the common language of.NET – The CLR- common language runtime; responsible for executing MSIL code; interfaces to Windows and IIS – A rich set of libraries (Framework Class Libraries) available to all.NET languages – The.NET languages such as C#, VB.NET etc that conform to CLR – ASP.NET is how the Framework is exposed to the web, using IIS to manage simple pages of code so that they can be complied into full.NET programs. These generate HTML for the browser. Built on open protocols (XML, SOAP) Future for development of MS & non-MS based systems. Also heading towards the “Internet Operating System”

Common Language Runtime Type System Compilers use the runtime type system to produce type compatible components Components Compilers Common Type System C#VBC++ Runtime Environment

.NET Execution Model VBVC...Script IL Native Code Common Language Runtime Standard JIT Compiler

Common Language Runtime Lightweight Just-in-time compiler: –MSIL to Native machine language; Can be ported to numerous platforms The compiled code is transformed into an intermediate language called the Microsoft Intermediate Language (MSIL or IL) An integer in Visual Basic.NET or an int in C# are converted to the same.NET data type, which is Int32 The IL that is created is the same for all languages The assembly is the compiled.NET program The assembly contains the IL along with additional information called metadata Metadata contains information about the assembly Use the IL Disassembler (ildasm.exe) to view the IL within an assembly

Framework Overview Base Class Library Common Language Specification Common Language Runtime Data and XML VBC++C# Visual Studio.NET Web Forms (ASP.NET) JScript… Win Forms

Namespace The base class libraries are organized into logical groupings of code called namespaces A namespace is a hierarchical way to identify resources in.NET The System object is at the top of the namespace hierarchy, and all objects inherit from it –ASP.NET: System.Web namespace –WebForms: System.Web.UI namespace –HTML Server Controls: System.Web.UI.Control.HTMLControl –ASP.NET Server Controls: System.Web.UI.Control.WebControl

Importing Namespaces Visual Studio.NET adds references to your projects ’ commonly used namespaces by default You can import the namespaces into your page using directive The following is the syntax for importing a.NET namespace Below is a sample of how you would import the ASP.NET Page class

Some ASP.NET namespaces SystemDefines fundamental data types eg system.string System.CollectionsDefinitions and classes for creating various collections System.IOFile reading & writing operations System.WebSupport browser/server communication System.Web.UICreates the Page object whenever an.aspx page is requested System.Web.UI.web controls Classes and definitions to create server controls

ASP.NET The latest version of ASP is known as ASP.NET Visual Studio.NET is a developer application used to create ASP.NET Web applications There are two main types of Web resources created with ASP.NET applications –WebForms are ASP.NET pages within an ASP.NET application –Web Services are ASP.NET Web pages that contain publicly exposed code so that other applications can interact with them –Web Services are identified with the file extension.asmx

WebForms The ASP.NET WebForm is separated into two logical areas: –The HTML template –A collection of code behind the WebForm The HTML template –Contains the design layout, content, and the controls –Creates the user interface, or presentation layer –Instructs the browser how to format the Web page –Is created using a combination of HTML controls, HTML Server controls, Mobile Controls, and ASP.NET controls

Server Controls HTML Server controls are similar to the HTML controls, except they are processed by the server Add runat = "server" to the HTML control to transform it into an HTML Server control HTML control: HTML Server control: Yes Server-side programs can interact with the control before it is rendered as a plain HTML control and sent to the browser

ASP.NET Controls ASP.NET form controls will create the HTML code ASP.NET Server controls are organized as: –ASP.NET Form Controls –Data Validation Controls –User Controls –Mobile Controls ASP.NET controls are usually identified with the prefix asp: followed by the name of the control ASP.NET button:

HTML Server Vs ASP.NET Server, Controls ASP.NET form controls can interact with client- side events such as when the user clicks on a button –When the event occurs, ASP.NET can trigger a script to run on the server ASP.NET form controls also have different properties than their HTML server control counterparts –HTML Server label control Message1.InnerHTML = "Product 1" –ASP server label control Message2.Text = "Product 2"

User Controls User controls are external files that can be included within another WebForm User controls allow you to reuse code across multiple files For example, you can create a user control that displays the a navigation bar You can use this control on the home page; they are often used for creating self-contained code, headers, menus, and footers User controls replace the functionality of ASP server-side include pages They are identified with the file extension.asmx

Other ASP.NET Server Controls Data validation controls –A series of controls that validate form data without extensive JavaScript programming Mobile controls –A series of controls that provide form functionality within wireless and mobile devices Literal controls –Page content that is not assigned to a specific HTML control such as a combination of HTML tags and text to the browser

Server Controls within Visual Studio.NET In Visual Studio.NET most of the ASP.NET Server controls are located on the Web Forms tab in the toolbox Server controls with Visual Studio.NET

The Code Behind Server programs are written in a separate file known as the code behind the page By separating the programming logic and presentation layer, the application becomes easier to maintain Only Server controls can interact with the code behind the page –Written in any ASP.NET compatible language such as Visual Basic.NET, C#, Perl, or Java –Filename is the same as the WebForm filename –Add a file extension that identifies the language Visual Basic.NET use.vb (mypage.aspx.vb) C# use.cs (mypage.aspx.cs)

Code Behind file The location of the code behind the page is determined via a property that is set on the first line in the page using directive directive allows you to set the default properties for the entire page such as the default language The CodeBehind property identifies the path and filename of the code behind file The Inherits property indicates that the code behind the page inherits the page class This page class contains the compiled code for this page

Compiling the Page Class The compiled code behind the page is the class definition for the page –A class is a named logical grouping of code –The class definition contains the functions, methods, and properties that belong to that class In Visual Studio.NET the process of compiling a class is called building –When you build the application, you compile the code into an executable file –Visual Studio.NET compiles the code behind the page into an executable file and places the file in the bin directory

Page Class Events The Page Class consists of a variety of methods, functions, and properties that can be accessed within the code behind the page The first time a page is requested by a client, a series of page events occurs The first page event is the Page_Init event which initializes the page control hierarchy The Page_Load event loads any server controls into memory and occurs every time the page is executed

Page class events Page_init Page_load Server_Controls Page_prerender Page_Unload

How ASP.NET works When.NET is installed, IIS is configured to look for files with the.aspx extension and to use the ASP.NET module (aspnet_isapi.dll) to handle them. ASP.NET parses the.aspx file and arranges it in a predefined class definition and generates an asp.net page object. The page object generates html that is sent back to IIS and then the browser. NOTE: only.aspx files are parsed (if it is pure html don’t save it as an aspx file as it will slow down the server.

ASP.NET samples Page directives: VB.NET code declarations ……….. Message.aspx Inserting ASP.NET code Example Line1: First HTML Line Line2: Second HTML Line Line3: Third HTML Line Note this has no asp code so better to use.html extension

Message2.aspx Sub Page_Load() Response.Write ("First ASP.NET Line ") Response.Write ("Second ASP.NET Line ") Response.Write ("Third ASP.NET Line ") End Sub Inserting ASP.NET code Example Line1: First HTML Line Line2: Second HTML Line Line3: Third HTML Line

Message3.aspx html> Inserting ASP.NET code Example Line1: First HTML Line Line2: Second HTML Line Line3: Third HTML Line Sub Page_Load() Response.Write ("First ASP.NET Line ") Response.Write ("Second ASP.NET Line ") Response.Write ("Third ASP.NET Line ") End Sub

Render or inline code block – interweave1.aspx Interweaving ASP.NET code and HTML Example Line1: First HTML Line ") %> Line2: Second HTML Line ") %> Line3: Third HTML Line ") %> NOT RECOMMENDED.

Interweave2.aspx A Server control script language="VB" runat="server"> Sub Page_Load() Message.Text="The ASP.NET line" End Sub Inserting ASP.NET code Example First HTML Line Second HTML Line