Beginning Web Site Development Module 1 – Dynamic Web Site Development Fundamentals of building dynamic Web sites with ASP.NET 2.0 and C# Version.

Slides:



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

11 Getting Started with ASP.NET Beginning ASP.NET 4.0 in C# 2010 Chapters 5 and 6.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
Web-Based Applications
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
Chapter 1: An Introduction To ASP.NET Web Programming
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Introduction to ASP.NET
Introduction to ASP.Net ISYS 350. ASP.NET ASP.NET is a server-side technology for creating dynamic web pages. ASP.NET allows you to use a selection of.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
11 ASP.NET Controls Beginning ASP.NET 4.0 in C# 2010 Chapter 6.
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.
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.
9-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
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.
A Scalable Application Architecture for composing News Portals on the Internet Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta Famagusta.
JavaScript & jQuery the missing manual Chapter 11
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
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.
Server-side Scripting Powering the webs favourite services.
.Net is a collection of libraries, templates and services designed to make programming applications of all kinds, easier, more flexible (multi platform),
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
ASP.Net Web Applications. Characteristics of a typical data driven web application Web Server HTML Graphics Active-X Java Applets HTTP Request ADO / JDBC.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 4-1 of…
INSPIRING CREATIVE AND INNOVATIVE MINDS Module 4: Adding Code to a Microsoft ASP.NET Web Form Implementing Code-Behind Pages Adding Event Procedures to.
ASP.NET Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours Digital.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
ASP.NET Web Server Controls Basic Web Server Controls.
© Minder Chen, ASP.NET 2.0: Introduction - 1 ASP.NET 2.0 Minder Chen, Ph.D. Framework Base Class Library ADO.NET: Data & XML.
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.
CSCI 6962: Server-side Design and Programming Introduction to Active Server Pages.
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.
Internet Technologies and Web Application Web Services With ASP.NET Tutorial: Introduction to.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Unit 3: Adding Code to a Microsoft ASP.NET Web Form.
Dynamic Dropdown Lists 1. Objectives You will be able to Use Dropdown Lists to solicit multiple choice user input in an ASPX web page. Populate a Dropdown.
Introduction to ASP.Net ISYS 512. ASP.NET in the.NET Framework 1. The client requests a web page. 2. The web server locates the page. 3. If the page is.
Week Developing Web Applications 12. Programming for the Web A Web Application Runs on a Web Server and Presents Its Content to the User Across a Network,
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Bookstore Application: Middle Tier Introducing Code-Behind Files, Session State.
ASP.NET 4 Unleashed Chapter 1. .aspx page: contains C# script and HTML code including tags. Listing 1.1 FirstPage.aspx.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
Christopher M. Pascucci.NET Programming: WebForm Events.
Module 4: Creating a Web Application with Web Forms
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
11 ASP.NET Server Controls Beginning ASP.NET in C# and VB Chapter 4.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
1111 Creating ASPX Controls Programatically Objectives You will be able to Dynamically add controls to a page. Dynamically alter properties of controls.
11 Getting Started with ASP.NET Beginning ASP.NET in C# and VB Chapters 1 and 2.
Building Custom Controls with ASP.NET and the Microsoft ®.NET Framework Rames Gantanant Microsoft Regional Director, Thailand
11 User Controls Beginning ASP.NET in C# and VB Chapter 8.
 ASP.NET provides an event based programming model that simplifies web programming  All GUI applications are incomplete without enabling actions  These.
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.
Computing with C# and the .NET Framework
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
ASP.NET Forms.
Web Forms, HTML, and ASP.NET
Chapter 8 User Controls.
Active Server Pages ASP.Net
Web Development in Microsoft Visual Studio 2013
Module 10: Creating a Web Application with Web Forms
ASP.NET.
Web Development Using ASP .NET
Programming with Microsoft Visual Basic 2008 Fourth Edition
Presentation transcript:

Beginning Web Site Development Module 1 – Dynamic Web Site Development Fundamentals of building dynamic Web sites with ASP.NET 2.0 and C# Version

Introduction Target audience New to programming but want to build a dynamic Web site Prerequisites Basic understanding of HTML, familiarity with Web interfaces Expectations Learn the basics of building dynamic Web sites with VWD Express and ASP.NET 2.0

Agenda Creating Web applications with VWD Creating new sites, working with pages Using ASP.NET 2.0 Server-side controls, code, and events Debugging Preparing for debugging and using VWD Deploying Using the Copy Website utility

Web site architecture Files Images Data Client browser Web Server Internet Request Response (HTML)

Creating a new Web site Choice of C# or Visual Basic for programming language

2 ways to add page content Type HTML directly (source view) Use the HTML toolbar (design mode)

Adding pages to your site Use the ‘Add new item...’ command Create new.aspx pages, HTML, and more... Right click ASP.NET Web Form HTML Page Style Sheet

Creating a Web site Setting up the initial site Adding and populating pages Using the HTML toolbox

Static versus dynamic content Static content Typically HTML files (.htm) – return the same thing each time requested Updates to content require updating.htm files Dynamic content ASP.NET Web Forms (.aspx) – can contain dynamically generated content No need to update.aspx files for new content Content typically drawn from other sources (databases, XML files, …)

ASP.NET Controls ASP.NET server-side controls Marked with “asp:” prefix Render as standard HTML Can be modified programmatically Shall I compare thee to a summer's day? Thou art more lovely and more temperate: Rough winds do shake the darling buds of May, And summer's lease hath all too short a date... Shall I compare thee to a summer's day? Thou art more lovely and more temperate: Rough winds do shake the darling buds of May, And summer's lease hath all too short a date... Renders as

Page loading Page load event Triggered as page prepares response Use to initialize ASP.NET control content Add handler by defining server-side method protected void Page_Load(object src, EventArgs e) { // Initialization code goes here }

Sample control modification Change control content in Page_Load Enables dynamic content without modifying.aspx files protected void Page_Load(object sender, EventArgs e) { if (DateTime.Now.Hour < 12) { sonnetLabel.Text = "Shall I compare thee to a......"; } else { sonnetLabel.Text = "When I do count the clock......"; } Shall I compare thee to a … When I do count the clock … Change Label content based on time of day (refer to control Using ID) After noon renders asBefore noon renders as

Complete dynamic page protected void Page_Load(object sender, EventArgs e) { if (DateTime.Now.Hour < 12) { sonnetLabel.Text = "Shall I compare thee to a......"; } else { sonnetLabel.Text = "When I do count the clock......"; } My sonnet page This sonnet will change every 12 hours Shall I compare thee to a summer's day?... Server code placed in <script runat="server" … section ASP.NET Server- Side Control

Available controls ASP.NET server-side controls Some simply mirror HTML tags Label ( ) TextBox ( ) Button ( ) DropDownList ( ) Table ( ) Panel ( ) Some render composition of HTML Calendar MultiView AdRotator

ASP.NET controls Using server-side controls Populating controls in Page_Load

Server-side events Some controls generate POSTs to server (issue another request to server) Subscribe to event to respond Button LinkButton DropDownList ListBox CheckBox (AutoPostBack='true' must be set to generate POST)

Handling a server-side event protected void MyButton_Click(object sender, EventArgs e) { ResultLabel.Text = "You clicked the button!"; } Postback controls Some controls that can post back <asp:Button ID="MyButton" runat="server" Text="Click me!" OnClick="MyButton_Click" /> On attribute in control (method and attribute added automatically with double-click in designer) Method defined with standard event handler signature

Code behind Server-side code in separate file Removes code from page, leaving only layout Page Language="C#" AutoEventWireup="true" CodeFile="CodeBehindSample.aspx.cs" Inherits="CodeBehindSample" %> <asp:Button ID="MyButton" runat="server" Text="Click me!" OnClick="MyButton_Click" /> public partial class CodeBehindSample : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { // initialize controls here } protected void MyButton_Click(object sender, EventArgs e) { ResultLabel.Text = "You clicked the button!"; } CodeBehindSample.aspx.cs

Events and code behind Using code behind pages Separating layout from logic Writing event handlers Responding to control events

Debugging with VWD VWD Express provides a full debugger Set breakpoints, step through code Inspect variables, controls when page runs Launch with Debug | Start Debugging (F5) Click to set break point Launch debug session

Debugging with VWD Step Into/Over Hover mouse over variable to see value Inspect local variable values Current line of execution

Debugging with VWD Preparing for debugging Setting breakpoints Inspecting variables

Deploying your site Deploying ASP.NET sites is just copying Copy all site files to live server FTP, Explorer drag+drop, xcopy, robocopy,... Copy Web Site utility available

Hosting options Many ASP.NET hosts available today Manage server for you Simply copy site files to host to deploy

Setting up IIS ASP.NET sites must be hosted in IIS ASP.NET hoster will set up an IIS application for you Hosting on your own machine requires IIS Development server for testing only (no remote access) Administrative Tools

Deploying Web sites Preparing IIS application on server Copying site Manually Using Copy Web Site utility

Summary Creating sites in VWD ASP.NET server-side controls Modify content dynamically Respond to events Debugging with VWD Deploying your site IIS preparation and copying the site