Unit 02. ASP.NET Introduction HTML & Server controls Postbacks Page Lifecycle.

Slides:



Advertisements
Similar presentations
ASP.NET Ajax Supplementary Tutorial. Why Use ASP.NET AJAX? - I ASP.NET AJAX enables you to build rich Web applications that have many advantages over.
Advertisements

1111 Creating ASPX Controls Programatically Objectives You will be able to Dynamically add controls to a page. Dynamically alter properties of controls.
Introduction to ASP.NET
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
11 ASP.NET Slides based off:. 22 B ACKGROUND - W EB A RCHITECTURE Web Server PC/Mac/Unix/... + Browser Client Server Request:
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Web-Based Applications
COS 381 Day 23. © 2006 Pearson Addison-Wesley. All rights reserved Agenda Capstone progress report Overdue –Only received 1 out of 6 Capstone projects.
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Introduction to ASP.NET
11 ASP.NET Controls Beginning ASP.NET 4.0 in C# 2010 Chapter 6.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 8: WebForms — Web-based.
ASP.Net, Web Forms and Web Controls 1 Outline Introduction Simple HTTP Transaction System Architecture Creating and Running a Simple Web Form Example Web.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
JavaScript & jQuery the missing manual Chapter 11
DR.JOHN ABRAHAM PROFESSOR UTPA ASP.NET. ACTIVE SERVER PAGES (ASP) Web application development environment Web applications use web browser to display.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
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.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
.Net is a collection of libraries, templates and services designed to make programming applications of all kinds, easier, more flexible (multi platform),
February 16, Aaron Cuffman Andy Nagle Adam Schultz Web Site.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Beginning Web Site Development Module 1 – Dynamic Web Site Development Fundamentals of building dynamic Web sites with ASP.NET 2.0 and C# Version.
Web Design ITM 2010 Tutorial 1 Prepared by Wang Shiyu.
INSPIRING CREATIVE AND INNOVATIVE MINDS Module 4: Adding Code to a Microsoft ASP.NET Web Form Implementing Code-Behind Pages Adding Event Procedures to.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
© Minder Chen, ASP.NET 2.0: Introduction - 1 ASP.NET 2.0 Minder Chen, Ph.D. Framework Base Class Library ADO.NET: Data & XML.
Chapter 4 – Working with ASP.NET Controls Dr. Stephanos Mavromoustakos.
ASP.NET Controls. Slide 2 Lecture Overview Identify the types of controls supported by ASP.NET and the differences between them.
CSCI 6962: Server-side Design and Programming Introduction to Active Server Pages.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part.
COMP3241 E-Business Technologies Richard Henson University of Worcester October 2012.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Unit 3: Adding Code to a Microsoft ASP.NET Web Form.
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.
Christopher M. Pascucci.NET Programming CodeBehind.
The Problem of State. We will look at… Sometimes web development is just plain weird! Internet / World Wide Web Aspects of their operation The role of.
The Module Road Map Assignment 1 Road Map We will look at… Internet / World Wide Web Aspects of their operation The role of clients and servers ASPX.
ASP.NET 4 Unleashed Chapter 1. .aspx page: contains C# script and HTML code including tags. Listing 1.1 FirstPage.aspx.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
Christopher M. Pascucci.NET Programming: WebForm Events.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
1 10/19/05CS360 Windows Programming ASP.NET. 2 10/19/05CS360 Windows Programming ASP.NET  ASP.NET works on top of the HTTP protocol  Takes advantage.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
11 ASP.NET Server Controls Beginning ASP.NET in C# and VB Chapter 4.
1 HTML Forms. Objectives You will be able to: Compose HTML forms, to accept input from the user. Identify the different kinds of input tags that can appear.
Overview of Previous Lesson(s) Over View  ASP is a technology that enables scripts in web pages to be executed by an Internet server.  ASP.NET is a.
Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,
PostBack  When an initial request for a page (a Web Form) is received by ASP.NET, it locates and loads the requested Web Form (and if necessary compiles.
Event Handling & Viewstate CS 351 Ed Gellenbeck. Today Review of Web Forms ASP.NET Object Hierarchy Events State Management Page State Session State Application.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
Computing with C# and the .NET Framework
ASP.NET Forms.
Web Forms, HTML, and ASP.NET
Introduction to Client-Server Programming
Web Development in Microsoft Visual Studio 2013
CS 3870/CS 5870 Web User Controls Events (II).
Anatomy of an ASP.NET Page
ASP.NET
ASP.NET.
ASP.NET Imran Rashid CTO at ManiWeber Technologies.
5/6/2019 Session 8.2 Postback, ViewState
Presentation transcript:

Unit 02. ASP.NET Introduction HTML & Server controls Postbacks Page Lifecycle

Creating an ASP.NET Project

Creating a ASP.NET Project File New Web Site… Web Site Location File System HTTP FTP Language VB.NET C#

ASP.NET Application Structure ASP.NET Folders App_Data App_Code App_LocalResources App_GlobalResources App_Browsers App_Themes Bin

ASP.NET Files Web Forms (.ASPX) and Code-behind files (.VB /.CS) Created in the root and subfolders of the site Classes & other shared code (.VB /.CS) Must go in the App_Code folder Global Application Class (Global.asax) Must go in the web root Web.config In the folder it applies to

Creating an ASPX page Web Site Add New Item… HTML / Design Views Controls can be dragged from the toolbox and initialised using the properties window

Page Elements HTML Tags Not interpreted by ASP.NET HTML Server Controls HTML Tags with RUNAT Attribute Can be manipulated using HtmlGenericControl Hello World

Page Elements Server Controls Expose specific methods and properties related to the control May be rendered as a single HTML tag, or set of tags Maintains its own state

Postback The page (including any controls on the page) stores it state in a hidden control within the form on the page When a form is submitted (by pressing a button) this information is posted back to the server The first request for a page is not a postback, but every subsequent request is

ASPX Page Object ASPX Request Life Cycle Incoming Request Control HTML HTML + State Outgoing Response HTML + State State

Adding code to the page Code can be added in two places Within the ASPX page In a separate (code-behind) file Location set when the page is created

Adding code to an ASPX Page Code is added in a script tag with a RUNAT="Server" attribute This is not ideal because the code and the design are mixed together Public _Message As String = Hello Sub SayHello() Response.Write(_Message) End Sub

Adding Code Behind A partial class is create to contain the code The partial class is compiled, with the ASPX page, to create the page class Page Object ASPX PageCode Behind +

Event Handling Code in an ASPX page is normally written in the form of event handlers Page Event handlers can be automatically "Wired up" Page_Load is used to initialise the page Protected Sub Page_Load() Me.Label1.Text = "Hello World End Sub VB

ASPX Page Life Cycle Init Load Unload Pre Render Load State Change Events Postback Event Save State

Control Events Change Events Occur before postback events Are triggered by a postback Can cause a postback if AutoPostback is set Postback Events There may be multiple change events, but there will only be one postback event

Add Control Event Handlers Control event handlers can be added with the properties window VB.NET uses the Handles notation C# uses control attributes (which can also be used in VB.NET) Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click VB

Lab Unit 2 Handling Control Events