ASP.NET Part I Dr. Awad Khalil Computer Science Department AUC.

Slides:



Advertisements
Similar presentations
 2004 Prentice Hall, Inc. All rights reserved. Chapter 23 – ASP.NET Outline 23.1 Introduction 23.2.NET Overview NET Framework ASP (Active.
Advertisements

Web Forms and ASP.NET Programming Right from the Start with Visual Basic.NET 1/e 12.
Objective Understand web-based digital media production methods, software, and hardware. Course Weight : 10%
ISYS 512 Business Application Design and Development with.Net David Chao.
ISYS 546 Client/Server Database Application Development.
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
ISYS 512 Business Application Design and Development with.Net David Chao.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
1 Chapter 20 — Creating Web Projects Microsoft Visual Basic.NET, Introduction to Programming.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Intro to dot Net Dr. John Abraham UTPA – Fall 09 CSCI 3327.
Rajeswari Indupuri Introduction to.NET Framework.
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
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.
INTRODUCTION TO WEB DATABASE PROGRAMMING
9-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
© 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.
CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms.
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
1 Web Server Concepts Dr. Awad Khalil Computer Science Department AUC.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
Object-Oriented Application Development Using VB.NET 1 Chapter 12 Web Forms, HTML, and ASP.NET.
HTML, GUI, ASP.NET Rina Zviel-Girshin Lecture 2
An Introduction to ASP.NET Ed Dunhill blogs.msdn.com/edunhill SLIDE7.
ISYS 512 Business Application Design and Development with.Net David Chao.
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.
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.
High thoughts must have high language. Aristophanes
 2002 Prentice Hall. All rights reserved. 1 Introduction to Visual Basic.NET,.NET Framework and Visual Studio.NET Outline 1.7Introduction to Visual Basic.NET.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
Creating Web Applications Using ASP.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
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.. 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.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
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.
Intro to dot Net Dr. John Abraham UTPA CSCI 3327.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
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,
Module 1: Overview of the Microsoft .NET Framework
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
CIS 375—Web App Dev II ASP.NET 1 Getting Started.
ISYS 512 Business Application Design and Development with.Net David Chao.
ASP.NET Part II Dr. Awad Khalil Computer Science Department AUC.
Understanding Web-Based Digital Media Production Methods, Software, and Hardware Objective
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.
Microsoft Visual Basic 2015 CHAPTER ONE Introduction to Visual Basic 2015 Programming.
Submitted by: Moran Mishan. Instructed by: Osnat (Ossi) Mokryn, Dr.
1 Introducing Web Developer Tools Rapid application development tools ASP.NET-compatible web editors –Visual Studio.NET Professional Edition –Visual Studio.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Introduction to Visual Basic. NET,. NET Framework and Visual Studio
ASP.NET Forms.
Introduction to Visual Basic 2008 Programming
Introduction to .NET Framework Ch2 – Deitel’s Book
Chapter 23 – ASP.NET Outline 23.1 Introduction NET Overview
CIS16 Application Development – Programming with Visual Basic
Presentation transcript:

ASP.NET Part I Dr. Awad Khalil Computer Science Department AUC

ASP.NET Content Introduction.NET Overview.NET Framework ASP (Active Server Pages).NET Setup JScript.NET A Simple ASP.NET Example Web Forms Session Tracking Cookies Session Tracking with HttpSessionState ASP.NET and XML Reading and Writing Text Files Connecting to a Database in ASP.NET Code-Behind Approach ASP.NET Web Services Web Resources

Objectives In this topic, you will learn: –To program ASP.NET pages using JScript.NET. –To understand how ASP.NET pages work. –To understand the differences between client-side scripting and server-side scripting. –To create Web services. –To use and manipulate XML files with ASP.NET. –To understand Web forms and code-behind files. –To be able to use session tracking in an ASP.NET application. –To use ActiveX Data Objects.NET (ADO.NET) to access a database.

Introduction ASP.NET –Server-side technology that dynamically builds documents in response to client requests. –Can be used on a server to create Web applications. –Supports over 25 programming languages. –ASP.NET takes advantage of.NET Framework, which provides thousands of classes that deal with XML, text input, validation of user input, image processing, and more. –ASP.NET also simplifies Web Services programming. –Object-oriented programming.

.NET Overview Independent from a specific programming language. Programmers can contribute to the same application, writing the code in any.NET-compatible languages (such as VB.NET, Visual C++.NET, and C#). Promotes software reuse. Include tools for porting, adapting existing software components. Web services, which are central to.NET initiative, extend the concept of Software reuse to the Internet by allowing developers to reuse software components that reside on another machine or platform. For example, a company developing an e-commerce application can subscribe to Web services that process payments and authenticate users – this enables programmers to focus on other unique aspects of the e- commerce application.

.NET Framework The.NET Framework is at the heart of the.NET strategy. It manages and executes applications, provides a class library, enforces security and supplies many other programming capabilities. Framework Class Library ( FCL ) –Enforces security and supplies many other programming capabilities –Reusable components that programmers can incorporate into their applications Common Language Runtime ( CLR ) –Executes programs written in any.NET-compatible programming language.NET Compact Framework.

.NET Compact Framework.NET Compact Framework enables developers to create applications for limited- resource devices, such as mobile phones and PDAs. Applications built using the Compact Framework can run on any device that has the Compact Framework installed. Users download applications onto a device through a wireless Internet connection or a connection from a PC. Once downloaded to the device, many applications do not require an Internet connection.

Common Language Runtime (CLR) CLR executes programs written in any.NET- compatible programming language..NET programs are compiled in two steps: –First, a program is compiled into Microsoft Intermediate Language ( MSIL ), which defines instructions for the CLR. Code translated into MSIL from multiple programming languages and sources can be woven together by the CLR. –MSIL then is compiled into machine code for a specific platform.

ASP (Active Server Pages).NET ASP.NET another integral part of the.NET initiative, is a technology for creating dynamic Web content marked up as HTML. ASP.NET developers can create multi-tier, database- intensive applications quickly by employing.NET’s object-oriented languages and the FCL’s Web controls (technically known as ASP.NET server controls ). Web controls look like HTML elements but are designed specifically for ASP.NET applications. Includes optimizations for performance, testing and security ASPX files XHTML documents –Static

ASPX Files ASP.NET applications consist of several file types. The first is.aspx, which we refer to as ASPX files. ASPX files contain the graphical user interface of a page, and may also contain the logic of the page (in the form of scripts written in a.NET- compatible language). These scripts are usually separated from the portion of the ASPX file that defines the page’s GUI. ASPX files often have a corresponding code-behind file that contains a class written in a.NET language, such as JScript.NET. This class includes initialization code, utility methods and other supporting code that provides the ASPX file’s programmatic implementation. Code-behinds help separate the business logic code from the presentation code. Code-behinds written in JScript.NET typically have an.aspx.js extension and are usually used in the middle tier of a three-tier Web- based application.

Setup Creating and viewing ASP.NET pages requires:  Microsoft.NET Framework. .NET Framework System Development Kit (SDK), which provides tools, examples, reference files and tutorials building.NET applications.

Setup Configuring a virtual directory as an application in IIS.

JScript.NET Truly object-oriented language. Backward compatible with JScript. Adheres to ECMA 262 Edition 4 standard. Provides classes, packages, typed variables and access to.NET Framework. Enables programmers to declare the types of variables, for example: var number : int, size : int; var word = StringBuilder() : StringBuilder;

A Simple ASP.NET Example Scripting delimiters –Wrapped around JScript.NET code –Compiled and executed on the server Page directive Specifies information needed by CLR to process file –Language attribute Specifies JScript.NET as scripting language –runat attribute with value “server” Indicates script should be processed on server

Outline date.aspx (1 of 2)

Outline date.aspx (2 of 2)

Outline HTML generated by date.aspx (1 of 2)

Outline HTML generated by date.aspx (2 of 2)

Commonly Used ASP.NET Objects An ASP.NET application when compiled, actually defines a class. The class inherits from class Page, provided by the.NET Framework. By inheriting from the Page class, the ASP.NET application gains access to several built-in objects that enable programmers to communicate with a Web browser, gather data sent by an HTTP request and distinguish between users.

Web Forms ASPX files are usually referred to as Web Forms or Web Form Pages because they normally process form input. Data entered into a form can be sent to the server, processed, then sent back to the client in different format. The first time a Web form is requested, the entire page is compiled. Later requests are served from the compiled page and do not have to be recompiled. Technically, any text file with an.aspx extension is an ASP.NET Web Forms page. Any pure HTML page can be given an.aspx extension and run as an ASP.NET page. Programmers customize Web Forms by adding Web controls, which include labels, text boxes,, images, buttons and other GUI components.

Web Controls Web controls normally have the attribute runat = “ server ” and are included within an ASP.NET Web Form designated by the tag. There are four types of Web controls: –HTML server controls Programmable HTML elements run on the server –Web server controls Form-like controls such as drop-down lists and text boxes –Validation controls ( validators ) Required field validator Range validator –User controls Created by programmer

Web Controls

Using Basic Web Server Controls The following example is an ASPX page that uses a form element containing server controls,,, and. An ASPX page can contain only one element. ASPX pages usually contain a form that, when submitted causes the current page to be requested again. This event is known as a postback. All the server controls and the form contain the attribute runat = “ server ” to designate that these components should be processed by the server.

Outline name.aspx (1 of 3)

Outline name.aspx (2 of 3)

Outline name.aspx (3 of 3)

Using Validators The following example adds validation controls to the name.aspx example. We use a required field validator and a range validator. A required field validator ensures that a field receives input. A range validator checks that input is within a specified range. The RequiredFieldValidator contains the attributes id (which defines the name of the validator control), ControlToValidate (which indicates the control whose input will be validated), Display (which sets the display behavior for the validation control), and runat = “ server ” (which specifies that this control should be processed by the server). Legal Display attribute values are None, Static, and Dynamic. Specifying Static or Dynamic causes the control to display an error message if validation fails.

Using Validators Several attributes control the behavior of the RangeValidator : ControlToValidate indicates the id of the server control to validate; MinimumValue specifies the smallest allowed input; MaximumValue specifies the largest allowed input; Type indicates the input’s allowed data type; EnableClientScript is a boolean value that specifies whether client-side validation is enabled or not; Text is the message that is displayed when validation fails; and runat specifies that this control is a server control.

Outline validation.aspx (1 of 4)

Outline validation.aspx (2 of 4)

Outline validation.aspx (3 of 4)

Outline validation.aspx (4 of 4)

Using Validators Validation error output.

Using Validators Validation error output.

Using Validators Valid page without validation errors.

Using AdRotator Web Control The AdRotator Web control simplifies the creation of advertising banners. The following example uses the AdRotator Web control. Using advertisement data located in an XML file, the AdRotator control randomly selects an image to display, then generates a hyperlink to the Web page associated with that image. Attribute AdvertisementFile specifies an XML file that contains advertisement information (i.e., an image file, URL, alternate text and relative frequency for each ad). The attributes BorderColor and BorderWidth specify the color and width (in pixels), respectively, of the border placed around the displayed banner ad.

Outline adRotator.aspx (1 of 4)

Outline adRotator.aspx (2 of 4)

Outline adRotator.aspx (3 of 4)

Outline adRotator.aspx (4 of 4)

Outline ads.xml (1 of 2)

Outline ads.xml (2 of 2) ASPX page with an AdRotator.