Static and Dynamic Web Pages

Slides:



Advertisements
Similar presentations
17 HTML, Scripting, and Interactivity Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and.
Advertisements

WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Tutorial 6 Creating a Web Form
Tutorial 6 Working with Web Forms
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
CST JavaScript Validating Form Data with JavaScript.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
INTRODUCTION TO DHTML. TOPICS TO BE DISCUSSED……….  Introduction Introduction  UsesUses  ComponentsComponents  Difference between HTML and DHTMLDifference.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
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.
Chapter 3 Using Validation Controls. What is a Validation Control? A control that validates the value in another control Renders as an HTML tag with an.
1 Forms A form is the usual way that information is gotten from a browser to a server –HTML has tags to create a collection of objects that implement this.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Object-Oriented Application Development Using VB.NET 1 Chapter 12 Web Forms, HTML, and ASP.NET.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
Chapter 9 Programming with Web Forms Programming In Visual Basic.NET.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
Website Development with Dreamweaver
NASRULLAH KHAN.  Lecturer : Nasrullah   Website :
HTML. Principle of Programming  Interface with PC 2 English Japanese Chinese Machine Code Compiler / Interpreter C++ Perl Assembler Machine Code.
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
Microsoft Visual Basic 2005 CHAPTER 7 Creating Web Applications.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
CS 3870/CS 5870 Web Protocols, Technologies and Applications.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
CA Professional Web Site Development Class 2: Anatomy of a Web Site and Web Page & Intro to HTML.
1 CS 3870/CS 5870 Note04 Session Variables and Post Back.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
Module 4: Creating a Microsoft ASP.NET Web Form. Overview Creating Web Forms Using Server Controls.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Introduction to HTML. _______________________________________________________________________________________________________________ 2 Outline Key issues.
NASRULLAH KHAN.  Lecturer : Nasrullah   Website :
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Bookstore Web Application: Client Tier Introducing Web Controls.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Beginning ASP.NET in C# and VB Chapter 9
HTML Structure II (Form) WEEK 2.2. Contents Table Form.
2440: 141 Web Site Administration Web Forms Instructor: Joseph Nattey.
Section 10.1 Define scripting
Web Protocols, Technologies and Applications
Chapter 5 Validating Form Data with JavaScript
Computing with C# and the .NET Framework
ASP.NET Forms.
Objective % Select and utilize tools to design and develop websites.
Web Forms, HTML, and ASP.NET
© 2016 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Learning the Basics – Lesson 1
ASP.NET Web Controls.
Section 17.1 Section 17.2 Add an audio file using HTML
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
Objective % Select and utilize tools to design and develop websites.
Cascading Style Sheets
Unit I: Collecting Data with Forms
Client side & Server side scripting
Chapter 27 WWW and HTTP.
Introducing ASP.net with Visual Studio Environment
HTML5 Level I Session I Chapter 1 - Introduction to Web Development
Web Protocols, Technologies and Applications
ASP.NET.
Web Development Using ASP .NET
Chapter 9 Programming with Web Forms
CIS 133 mashup Javascript, jQuery and XML
5.00 Apply procedures to organize content by using Dreamweaver. (22%)
Programming with Microsoft Visual Basic 2008 Fourth Edition
Brief Look InTo JavaScript
Presentation transcript:

Static and Dynamic Web Pages CS 3870 Static and Dynamic Web Pages ASP.NET and IIS

Static Web Pages Original HTML documents Remaining the same after created and modified At all times and to all users All three pages of Prog1 are static

Static Web Pages Cannot be used for business operations No user input Cannot respond to different user requests

Dynamic Web Pages Interactive or Smart HTML pages User input and Server Response Web Applications Similar to Windows programs Prog2

Special HTML Controls To get user input Element INPUT Element BUTTON Element FORM …

Control Types Created with INPUT Text Password Checkbox Radio box Submit Reset Hidden Button File Image . . .

Controls to get user input MUST be inside HTML forms

HTML Controls and Forms Example View Source Code (Google Chrome, Edge F12)

HTML Standards by W3C

Scripts for Dynamic Web Pages User Input and Server Response Similar to Windows programs Need code to respond to user input Client Side Scripting Server Side Scripting Combination of above two approaches

Client Side Scripting HTML files and instruction files sent to client Client Script JavaScript: nothing to do with Java VBScript Java Applets Flash . . .

Issues with Client Side Scripting Different browsers may interpret instructions in different ways Database is normally at server site Users could view source code

Server Side Scripting Instruction files are at server site HTML files are generated according to user input Only HTML files are sent to clients

Issues with Server Side Scripting Most computing is done at the server Nothing will work when the server is down Powerful and expensive servers More internet traffic

Different Technologies for Server Side Scripting CGI (Common Gateway Interface) JSP (Java Server Pages) PHP (Personal Home Pages) ASP (Active Server Pages) ASP.NET . . .

ASP.NET A server-side technology for creating dynamic web pages Client-side scripting is incorporated (e.g., to check input) C#, VB.NET or any other language supported by .NET Working with MS IIS

Internet Information Services (IIS) IIS waits and takes client requests IIS sends static HTML files to the clients IIS passes client requests to ASP.NET when needed ASP.NET generates dynamic web pages IIS sends dynamic web pages to clients

Program 2 20 points Using C#, Not VB.NET Due 10 pm, Monday (Week 3), September 17

Creating Folder Solution Explore Right Click on Web Site New Folder Prog2

Creating Web Forms Solution Explorer Right clicking folder Prog2 Add Different Views Design Source: HTML code Split

Page Default.aspx Static page for Prog2 Similar to index.html

Page OrderingProduct.aspx Dynamic page for Prog2 Adding controls Three textboxes Two buttons Standard on Toolbox Not HTML

HTML Server Controls HTML Server Controls HTML server controls are HTML elements (or elements in other supported markup, such as XHTML) containing attributes that make them programmable in server code. We don’t use HTML Server Controls.

Web Server Controls Web server controls are a second set of controls designed with a different emphasis. Web server controls do not necessarily map one-to-one to HTML server controls. All Server Controls must be within a <form> tag. All Server Controls must have the runat="server" attribute. We use Web Server Controls!

Basic Control Properties <asp:TextBox ID="txtPrice" runat="server"</asp:TextBox> <asp:TextBox ID="txtQuantity" runat="server"></asp:TextBox> <asp:TextBox ID="txtTotal" runat="server" ReadOnly="True" > </asp:TextBox> <br /> <br /> <asp:Button ID="Button1" runat="server" Text="Compute" /> <asp:Button ID="Button2" runat="server" Text="Reset" />

Event Procedures Same as Windows programs C# Button Compute Button Reset

Button Compute protected void Button1_Click(object sender, EventArgs e) { float price = float.Parse(txtPrice.Text); int quantity = int.Parse(txtQuantity.Text); float total = price * quantity; txtTotal.Text = total.ToString(); txtPrice.ReadOnly = true; txtQuantity.ReadOnly = true; } Try one invalid input value

Button Reset protected void Button1_Click(object sender, EventArgs e) { txtPrice.Text = ""; txtQuantity.Text = ""; txtTotal.Text = ""; txtPrice.ReadOnly = false; txtQuantity.ReadOnly= false; } Try one invalid input value

Formatting Server Controls Style Source View CSS file Format Menu

Format Menu Go to Design view Click FORMAT on the menu bar New Style Selector HTML element Enter a style name Inline style Define in Specify the styles OK or Apply

Internal Style Sheets <head> <style type="text/css"> .theTitle { font-family: "Bell MT"; font-size: xx-large; font-weight: bold; color: #0000FF; text-decoration: underline; text-align: center; } </style> <h1> Web Protocols, Technologies and Applications </h1> </head>

Internal Style Sheets <head> <style type="text/css"> .theTitle { . . . } <title>CS3870 – Prog 2</title> </head> <body> <h1 class="theTitle">Web Protocols, Technologies and Applications</h1> </body> </html>

Inline Style Selecting Controls Position: relative or absolute z-index: auto Display: inline-box Text-align Width: 10% Margin-left: 10%

<br /> <br /> <asp:TextBox ID="txtPrice" runat="server" style="display: inline-block; position: relative; width: 10%; text-align: left; margin-left: 25%; z-index: auto;"></asp:TextBox> <asp:TextBox ID="txtQuantity" runat="server" style="margin-left: 10%; display: inline-block; position: relative; z-index: auto; width: 10%"></asp:TextBox> <asp:TextBox ID="txtTotal" runat="server" ReadOnly="True" z-index: auto; width: 10%"; text-align: right"></asp:TextBox>

Formatting Output Style in HTML source Properties Window C# functions String formatting txtTotal.Text = string.Format("{0:c}", total);

Checking Input Click event of button Compute Server site scripting Client site scripting should be better Should do it on both sites Control Validator

Validators ToolBox Validation Tab ControlToValidate RequiredFieldValidator RangeValidator CompareValidator Type Operator Value to compare

Validation Controls Validate input automatically We don’t check input in event procedures any more Must set button property CausesValidation to True!

Validation Controls Will check input data at both sides Placing validation controls Inline-box Margin could be negative

Program 2 You will lose five points for each late day! More to discuss next class!