Unit 27 - Web Server Scripting

Slides:



Advertisements
Similar presentations
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?
Advertisements

MY NCBI (module 4.5). MODULE 4.5 PubMed/How to Use MY NCBI Instructions - This part of the:  course is a PowerPoint demonstration intended to introduce.
MY NCBI (module 4.5).
Introduction to Online Data Collection (OLDC) Community Based Abstinence Education September, 2009.
1 Welcome to the Colgate University Online Employment System Applicant Tutorial.
Printing and Page Formatting ITSW 1401, Intro to Word Processing Instructor: Glenda H. Easter.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Website Tutorial. Administration  Log on by clicking Login on the footer of almost any page  Your Username is.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Welcome to the Southeastern Louisiana University’s Online Employment Site Applicant Tutorial!
Setting up MyChisholm. Access the Chisholm website From any of the Chisholm campuses the website is accessible either by clicking home or typing “intranet”
9-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
If you are very familiar with SOAR, try these quick links: Principal’s SOAR checklist here here Term 1 tasks – new features in 2010 here here Term 1 tasks.
Welcome to the University of West Florida Online Employment System Applicant Tutorial.
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.
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
Telerik Software Academy ASP.NET Web Forms Data Validation, Data Validators, Validation Groups Telerik Software Academy
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
ASP.Net, Web Forms and Web Controls 1 Outline Web Controls Text and Graphics Controls AdRotator Control Validation Controls.
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.
® IBM Software Group © 2006 IBM Corporation Programmatically Rendering and Hiding JSF Controls This section describes how to hide and show JSF controls.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Programming with Visual Web Developer Chapter 9.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
C# Tutorial -1 ASP.NET Web Application with Visual Studio 2005.
Microsoft Visual Basic 2005 CHAPTER 7 Creating Web Applications.
1. To start the process, Warehouse Stationery (WSL) will invite you to use The Warehouse Group Supplier Electronic Portal and will send you the link to.
Training Guide for Inzalo SOP Users. This guide has been prepared to demonstrate the use of the Inzalo Intranet based SOP applications. The scope of this.
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
1 Chapter 12 – Web Applications 12.1 Programming for the Web, Part I 12.2 Programming for the Web, Part II 12.3 Using Databases in Web Programs.
Database Handling, Sessions, and AJAX. Post Back ASP.NET Functionality The IsPostBack method in ASP.NET is similar to the BlackBerry.refresh method –IsPostBack.
Lesson 12 Adding Validation To The Movie Database.
AUC Technologies Projects Consulting, Development, Mentoring, and Training Company ASP.NET Validation Control Presented By : Muhammad Atif Hussain Deputy.
VALIDATION CONTROLS.  Validation Controls are primarily used to validate, or verify the data entered by user into a web form.  Validation controls attempt.
Office of Housing Choice Voucher Program Voucher Management System – VMS Version Released October 2011.
1 State and Session Management HTTP is a stateless protocol – it has no memory of prior connections and cannot distinguish one request from another. The.
MIS 3200 – Unit 3.2 Page_Load method AutoPostBack property of controls IsPostBack method of the Page object Understanding web page life cycle.
IT533 Lectures ASP.NET AJAX.
Learning Aim C.  In this section we will look at how text, tables, forms and frames can be used in web pages.
Beginning ASP.NET in C# and VB Chapter 9
1.Switch on the computer and wait for loading. 2.Select the Windows 7 OS at the end of the list. 3.Click on the link ‘Administrator’ 4.Enter the administrator.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
Validation & Rich Controls
Unit & District Tools Phase 1
Journal of Mountain Science (JMS)
Unit 7 Learning Objectives
Coldpruf Online Order Form
CS3015 Beacon Module 4 Messenger & Setting Preferences
Administrator Training
– Officiating Management Software
Bomgar Remote support software
Web Programming– UFCFB Lecture 17
How to Use Members Area of The Ninety-Nines Website
New Mexico Emergency Operations Center (NMEOC) Basic ETeam Training
Intro to PHP & Variables
Unit I: Collecting Data with Forms
1CapApp Company Setup Documentation
What is Cookie? Cookie is small information stored in text file on user’s hard drive by web server. This information is later used by web browser to retrieve.
Integrating JavaScript and HTML
Tutorial 6 Creating Dynamic Pages
12/9/2018 Session 9.1 Calendar and Validation Controls Using Sessions
Web Development Using ASP .NET
Unemployment Insurance Agency Michigan Web Account Manager
Inside a PMI Online Course
5/6/2019 Session 8.2 Postback, ViewState
Programming with Microsoft Visual Basic 2008 Fourth Edition
Coldpruf Online Order Form
Presentation transcript:

Unit 27 - Web Server Scripting Week 2 Lesson 2 – Validation and Server Side actions

Previously… Capturing User Information Processing User Input

This Lesson Validation Server Side Processing

Validation Controls Form fields are completed Values correspond to a particular format Two fields contain the same value Validation controls format – email address Within a particular range Same value – password confirmation The validation is automatically performed by the control and an error message issued if the validation fails. You do not have to do any coding – only set the correct control properties Validation summary will provide of all the output from the validation control son a page. Can be useful for error checking.

Find the requiredfieldvalidator tool and drag to the web form

Using the Mailing list previous example - Each of these controls are set up by setting the relevant properties. Each control has a ControlToValidate property ErrorMessage property, etc For the regular expression validator – set the ValidateExpression property by clicking on the … to the right of the box. This displays a list of the preset expression for you to choose from eg phone numbers, email etc. NOTE – all it can check is that the format matches the one selected.

Using the Mailing list previous example - Now we have a table of three columns (use the layout tab to add columns or rows to a table)

How ASP.NET works…. User requests a page Request is sent to the web server Web server – If pure HTML then page returned to user If ASP.NET then server processes page User receives HTML page. User requests a page either by typing it in on the address bar of a browser or by clicking a link on a page. Important point – HTML is rendered by the browser on the user’s machine. All the server sends back is a stream of text. Request is sent to the web browser hosting that page. Web server – If pure HTML then page returned to user If ASP.Net then server processes page. This means that ASP.NET will examine the page and see if there is anything it needs to do. This is defined as Server Side Processing as it is happening on the server. The end result of the processing is HTML which is sent back to the user. User receives the HTML page and the browser examines the HTML and shows the page with all the formatting – this is called rendering.

Server-side Processing Statelessness Nothing is maintained in code between page loads Only refers to standard HTML elements & code Postback Information from a control is posted back to the server ASP.NET runs the control and it posts back to browser Server-side events Events are actions that take place when something or someone interacts with a web page Page load event Statelessness – loading a page the first time is different from loading it a second time. ASP.Net has no knowledge of the previous times the page has been loaded. Example – a site where the user logs in. first time user message says ‘Welcome stranger, please login. Second time page loaded message should say ‘welcome’ & User Name ASP.Net assumes they are separate pages so you have to check each time the page loads to see whether the user is logged in for example. Statelessness does not refer to Web controls as these have an inbuilt ability to retain their values each time a page is requested. Postback – think of it in terms of a letter being posted to ASP.NET which then writes a new letter back to you and so on… The postback causes the page to be sent to ASP.NET, which runs thru any processing it needs to and sends the resultant HTML back to the user. The process is the same every time the page is loaded. It has no knowledge of whether the page was loaded before. Events are actions that take place when something or someone interacts with a web page. EG when a button is clicked, an event is generated or RAISed. There is an events button at the top of the properties box for each control. Page load event can be used to detect whether the page has been loaded before by using the IsPostBack property.

Page Load Event Select the “code-behind” tab to show the “code-behind” window. Choose “page-events” from the left hand drop-down list. Choose “Load” from the right-hand drop-down list to display the page load event sub routine. Any actions you want performed on page load can be entered here and will be run each time the page is loaded.

Make a new web page Add the following in order: Button Label

Double Click the Button Add the following code: Label2.Text = "The button has been clicked"

Double Click the Page Add the following code to the pageLoad event: If Page.IsPostBack Then Label1.Text = "The page has been loaded because of a button click" Else Label1.Text = "The page has loaded for the first time" End If Label2.Text = ""

Detecting Postback This is an example of loading a page and detecting postback. The ispostback property is true if the page is being redisplayed, as in the case of a button click. For the first time ispostback is false.

When you try to refresh the page, a message is displayed

Server Side Example Panel LinkButton Why not a HyperLink? Rectangular area Visibility controlled server side LinkButton Click method Returns to same page Why not a HyperLink? Goes to any web page including current one No Click method There is a server-side webform control called a "Panel." A Panel is a rectangular area on your HTML page, the visibility of which can be controlled on the server side. "LinkButton," which is essentially a hyperlink, but can be made to behave like a button via the Click server-side method. Why am I using a LinkButton instead of a hyperlink? The implication of a hyperlink is that you are free to go to any Web page, including the current one. But there is no implication that I want to return to the same page while altering parts of that page. In addition, there is no server-side, convenient method like Click available with a hyperlink. The LinkButton control offers the look and feel of a hyperlink, but with two other benefits, namely: The intention of coming back to the same page when pressed. The convenient method of Click.

Add a Panel Start a new website Add a panel to the first div Press the right arrow key and the press enter twice Add two more panels in this way In panel 1 type: An example of a panel that is going to disappear Change the panel ID to testPanel1 In panel 2 type: Enter your password Change the panel ID to testPanel2 In panel 3 add a button and change the text to: Enter Change the panel ID to testPanel3

Add a link Below the div add the following: A link button Change the text to: Click Me!!

Double Click the Link Button Add the following code to the linkButton section: If TestPanel1.Visible Then TestPanel1.Visible = False Else TestPanel1.Visible = True End If

The idea is that once you set the panel visibility to "false," the entire HTML segment will disappear from view. Every control on your page is represented as a .NET object on the server side. Moreover, the state of these objects (or controls) is maintained between multiple round trips to the server. This allows you to respond to events either on the client or on the server side. While responding to events on the server side, rest assured that when the page is repainted, all of its internals will repaint as if nothing had happened.

Tutorial