© 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.

Slides:



Advertisements
Similar presentations
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
Advertisements

1 Chapter 12 Working With Access 2000 on the Internet.
Web Forms: Web Pages with Server Controls. 2 Objectives Understand the background of the Internet, and the notions of packet switching and a stateless.
The Microsoft View: Module 1: Getting Started. Copyright Course 2559B, Introduction to Visual Basic®.NET Programming with Microsoft®.NET. Lecture 1 Microsoft.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
Web-Based Applications
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
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.
Intro to dot Net Dr. John Abraham UTPA – Fall 09 CSCI 3327.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Beginning Active Server Pages Barry Sosinsky Valda Hilley Programming.
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
Chapter 1 Variables in the Web Design Environment.
ASP.Net, Web Forms and Web Controls 1 Outline Introduction Simple HTTP Transaction System Architecture Creating and Running a Simple Web Form Example Web.
Chapter 9 Web Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
INTRODUCTION TO WEB DATABASE PROGRAMMING
McGraw-Hill© 2007 The McGraw-Hill Companies, Inc. All rights reserved. 1-1.
A First Program Using C#
Introduction to.Net and ASP.Net Course Introduction Build Your Own ASP.Net Website: Chapter 1 Microsoft ASP.Net Walkthrough: Creating a Basic Web Forms.
© 2004 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Programming the Web Using ASP.Net Chapter 1: ASP.Net Dave Mercer.
9-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
DHTML. What is DHTML?  DHTML is the combination of several built-in browser features in fourth generation browsers that enable a web page to be more.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Lecture Roger Sutton CO530 Automation Tools 5: Class Libraries and Assemblies 1.
1 Introduction to.NET Framework. 2.NETFramework Internet COM+ Orchestration Orchestration Windows.NET Enterprise ServersBuildingBlockServices Visual Studio.NET.
Introduction to .Net Framework
An Introduction to ASP.NET Ed Dunhill blogs.msdn.com/edunhill SLIDE7.
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
ASP.NET The.NET Framework. The.NET Framework is Microsoft’s distributed run-time environment for creating, deploying, and using applications over the.
Module 1: Introduction to C# Module 2: Variables and Data Types
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
Understanding Code Compilation and Deployment Lesson 4.
ASP.NET  ASP.NET is a web development platform, which provides a programming model, a comprehensive software infrastructure and various services required.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Dynamic Action with Macromedia Dreamweaver MX Barry Sosinsky Valda Hilley.
Chapter 9 Programming with Web Forms Programming In Visual Basic.NET.
Lecture 1 Programming in C# Introducing C# Writing a C# Program.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
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.
ASP.NET.. ASP.NET Environment ASP.NET is Microsoft's programming framework that enables the development of Web applications and services. It is an easy.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Programming with Visual Web Developer Chapter 9.
.NET Framework Danish Sami UG Lead.NetFoundry
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.
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
Introduction to ASP.NET T.Ahlam Algharasi. The Visual Studio IDE Start page 2.
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: Getting Started. Introduction to.NET and the.NET Framework Exploring Visual Studio.NET Creating a Windows Application Project Overview Use Visual.
PAGE DIRECTIVES. Page Directives  They are instructions, inserted at the top of an ASP.NET page, to control the behavior of ASP.NET pages.  So it is.
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,
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
Understanding Web Applications Lesson 4. Objective Domain Matrix Skills/ConceptsMTA Exam Objectives Understanding Web Page Development Understand Web.
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.
Text Introduction to.NET Framework. CONFIDENTIAL Agenda .NET Training – Purpose  What is.NET?  Why.NET?  Advantages  Architecture  Components: CLR,
Building Custom Controls with ASP.NET and the Microsoft ®.NET Framework Rames Gantanant Microsoft Regional Director, Thailand
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.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
© 2004 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Programming the Web Using ASP.Net Chapter 6: The User Interface (UI) Dave.
Introduction to .NET Framework Ch2 – Deitel’s Book
Module 1: Getting Started
Web Development in Microsoft Visual Studio 2013
Web Development Using ASP .NET
Presentation transcript:

© 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 Mercer

2-2 Objectives 1.Explain the logical difference between Web applications and Web Services 2.Use the ASP.Net template to create a VB.Net project in VS.Net 3.Work with the Solution Explorer to navigate project files 4.Describe the functions of ASP.Net template files 5.Work with the Styles.css file 6.Add and Delete files from the project 7.Describe what ASP.Net Directives are 8.Explain what ASP.Net Directives do 9.Modify ASP.Net Directives in an ASP.Net file 10.Describe how ASP.Net Server controls are coded in a Web form

2-3 The ASP.Net Web Application Template Using an IDE such as Visual Studio.Net (VS.Net) speeds up the process of writing ASP.Net documents. One way VS.Net speeds up this process is by providing project templates for these applications, as well as for other commonly programmed items (such as Windows applications and Web Services).

2-4.NET Structures and Languages The.Net Framework has many interfaces and classes built-in, and also has the Common Language Runtime to process applications made from the interfaces and classes. The Common Language Runtime (CLR), supported communications protocols, built-in application objects and classes, and support for a number of popular programming languages are what makes the.Net Framework an effective platform for Windows and Web applications

2-5 The Common Language Runtime (CLR) The Common Language Runtime (CLR) provides a managed execution environment in which multiple languages can be used to write the various parts of an application. It also provides exception handling across those languages, memory management, thread management, better security, and versioning, deployment, debugging, and profiling services. Appropriate languages include Visual Basic.Net and C# (a managed version of C++).

2-6 Microsoft Intermediate Language Specification (MSIL) Code compiled for the CLR is compiled into MSIL. MSIL is a set of instructions that can be efficiently turned into code native to whatever CPU it runs on. MSIL is not dependent upon a particular CPU, and is therefore much more portable than traditionally compiled code. Once on the machine it runs on, MSIL is turned into native code by a Just-In-Time compiler.

2-7 Migrating from ASP to ASP.Net Typical ASP documents include ASP and some scripting language code (often VBScript) embedded within HTML code. Web pages are created as though a normal Web page is the intended outcome, but programmers add ASP to standard design templates so that what the user sees in the browser varies dynamically. Many application-style actions are available, such as redirection to another page, but the user’s browser receives only the finished product.

2-8 Differences Between ASP and ASP.Net: Using ASP.Net Server Controls One of your first steps in migrating from an ASP application would be to rebuild the basic pages and separate out programming code from HTML (or XHTML) code. Programming code would be inserted into event handlers in the codebehind page, while display code would be left in a file with an extension of.aspx rather than.asp. You can also substitute ASP.Net Server controls for the old-fashioned HTML controls.

2-9 Differences Between ASP and ASP.Net: Using Page Directives Another change is in the way page directives are handled. In ASP, you might find a few lines at the top of the page that resemble the following: Change this to:

2-10 Differences Between ASP and ASP.Net: VB.Net Syntax There are differences in the way certain arguments are expressed for functions and methods in ASP and ASP.Net. For example, it is permissible to write a response in ASP as follows: Response.write "This is my message" In ASP.Net, the response must be written: Response.write("This is my message") All arguments must be properly enclosed in parentheses.

2-11 Differences Between ASP and ASP.Net: Variable Declaration and Data Types In ASP, using VBScript, variables are not required to be declared. If you begin to use variables without declaring them first they are simply used, and no data type is required. In ASP, values are assigned a data type of “Variant,” which no longer exists in ASP.Net and VB.Net). In ASP.Net, you’ll need to identify all variables and specifically declare them with the appropriate data type.

2-12 Project, Templates, and Template files Project Types Such As: Visual Basic Projects C# Projects Template Types Such As: ASP.Net Web Applications ASP.Net Web Services Project Types Such As: Global.asax C# Projects

2-13 Creating a New Project in ASP.Net

2-14 References A project’s References node contains: –System –System.Data –System.Drawing –System.Web, and –System.XML. Each reference name refers to a.Net Framework namespace that contains fundamental and base classes and interfaces that support Web-based communications, events and event handlers, data and graphics processing, and XML processing.

2-15 References (2) Each reference has a “Name” attribute and an “AssemblyName” attribute. These references refer to assemblies that are included in the Global Assembly Cache. –The global assembly cache is a machine-wide code cache that stores assemblies meant to be shared by multiple applications on the computer (for example, on the server running your Web application).

2-16 The bin Folder The “bin” folder contains your Dynamic Link Library (.dll) file and your Program Debug Database (.pdb) files. –The DLL file contains a library of classes created from your Web forms and controls when the project is built (or compiled). –The PDB file contains debug information that is created when you build your application in debug mode.

2-17 The AssemblyInfo.vb File When you create a project in a solution with Visual Studio.Net, you are creating an assembly. Assemblies form a logical unit that can include security, version, type, and other pertinent information. Assembly attributes include the following types: identity, informational, manifest, and strong name. Each attribute has a specific name. Some are defined automatically while others can be set by the developer.

2-18 The Global.asax File The global.asax file is an optional file, but is highly useful in ASP.Net Web applications. It contains code for responding to application and session events. The term application event means an event that happens to the entire application. The Global.asax.resx file is used to store data that does not change, such as error messages. This simplifies changing this data content without affecting the rest of the application.

2-19 The Styles.css File The Styles.css file contains data for Cascading Style Sheets styles. Cascading Style Sheets (CSS) is actually a language for specifying elements and setting the properties of these elements globally or individually by defining values for them. Elements and the property values assigned to them are specified in CSS as a selector and a declaration. A single stylesheet file can be linked to all Web pages in an application.

2-20 The Web.config File ASP.Net Web applications can be configured with specialized configuration files. The Web.config file is formatted as an XML file. The first element is “configuration” and all other elements in the document are contained within this element. If you are using VS.Net to develop your application, the Web.config file will be edited for you when you change settings (such as turning off debug mode).

2-21 The WebAppStructure.vsdisco File Files ending in.vsdisco are for making discovery of Web Services possible. These files are formatted as XML documents, and included by default in ASP.Net Web Applications even though they are for discovering XML Web Services. These files are included because many of the Web applications you create will include Web Services.

2-22 WebForm Files The WebForm1.aspx file contains HTML and XML elements making up the rendered display in the user’s browser. The WebForm1.aspx.vb file is called the “codebehind” file. It contains the code that runs when controls on your form respond to events. The WebForm1.aspx.resx file is used to store resources applicable to the Web form.

2-23 ASP.Net Page Processing The.Net Framework provides classes from which objects can be derived for Windows and Web applications, among other programmed structures. ASP.Net provides not only classes from which objects useful for Web applications can be derived, but is also a complete Web platform for any Web application you develop. You can use any language you like that is compatible with the Common Language Runtime (CLR).

2-24 ASP.Net Page Processing (2) The ASP.Net page framework is the Web server architecture that dynamically produces and manages Web forms. The ASP.Net page framework automatically maintains the state of the page and its controls. Unlike ASP, ASP.Net pages typically use two files to contain the display code and the programming code. The file extensions for these pages are.aspx and.aspx.vb (or.aspx.cs with C#).

2-25 The ASP.Net Compilation Process Files containing code-behind classes are all compiled into a dynamic-link library or.dll file for the project they are a part of. The first time a user requests an.aspx page in your Web application, a.Net class file is automatically generated from that page and then compiled into a second.dll file that inherits from the overall.dll file. Thereafter, any call to that page is responded to by the application running as an executable program.

2-26 Page Processing The basic class in an ASP.Net Web application is the page class. A Web forms page goes through a series of page processing steps every time it is requested: initialize, process, and dispose. A special stage called render is performed towards the end of the processing cycle, and it is during this stage that the HTML output is created.

2-27 ASP.Net Directives ASP.Net Directives are settings used when a page or control is compiled. The actual page browsed to by the user is compiled dynamically, and Page directive contains an attribute (named Inherits) that defines the class from which the.aspx file derives. Although directives can be placed in any location in your file, the traditional place to locate them is at the top of the file.

2-28 General Layout of Directives in ASP.Net Files

2-29 Coding Directives Page Directive Control Directive Import Directive Implements Directive Register Directive Assembly Directive Output Cache Directive Reference Directive

2-30 The End