Www.tech.findforinfo.com1 Web Form Fundamentals Chapter-2 Unit-2.

Slides:



Advertisements
Similar presentations
PHP Form and File Handling
Advertisements

CGI & HTML forms CGI Common Gateway Interface  A web server is only a pipe between user-agents  and content – it does not generate content.
Lecture 6/2/12. Forms and PHP The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input When dealing with HTML forms.
Current Popular IT I Pertemuan 3 Matakuliah: T0403/Current Popular IT I Tahun: 2008.
JavaScript Forms Form Validation Cookies. What JavaScript can do  Control document appearance and content  Control the browser  Interact with user.
Asp.NET Core Server Controls. Slide 2 Lecture Overview Understanding the types of ASP.NET controls HTML controls ASP.NET (Web) controls.
1 Chapter 12 Working With Access 2000 on the Internet.
JavaScript Forms Form Validation Cookies CGI Programs.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
1 Software Testing and Quality Assurance Lecture 32 – SWE 205 Course Objective: Basics of Programming Languages & Software Construction Techniques.
Introduction to ASP.NET
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
ASP.NET Programming with C# and SQL Server First Edition
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Beginning Active Server Pages Barry Sosinsky Valda Hilley Programming.
Chapter 9 Collecting Data with Forms. A form on a web page consists of form objects such as text boxes or radio buttons into which users type information.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
PHP Tutorials 02 Olarik Surinta Management Information System Faculty of Informatics.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
1 Presented by Bikash Shrestha. 2 What is ASP.NET or ASP+? ASP.NET/ASP+ is a programming framework built on the common language runtime that can be used.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
Overview of Previous Lesson(s) Over View  Server controls are small building blocks of the graphical user interface, which includes  Text boxes  Buttons.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
JavaScript, Fourth Edition
State Management. What is State management Why State management ViewState QueryString Cookies.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
ASP.NET Controls. Slide 2 Lecture Overview Identify the types of controls supported by ASP.NET and the differences between them.
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.
Chapter 8 Cookies And Security JavaScript, Third Edition.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
CIS 451: ASP.NET Objects Dr. Ralph D. Westfall January, 2009.
Website Development with PHP and MySQL Saving Data.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Christopher M. Pascucci Basic Structural Concepts of.NET Managing State & Scope.
ASP.NET OPTIMIZATION. Why Optimize? $$$ Whether you build applications for customers or not, enhanced applications save money.
STATE MANAGEMENT.  Web Applications are based on stateless HTTP protocol which does not retain any information about user requests  The concept of state.
Module 4: Creating a Microsoft ASP.NET Web Form. Overview Creating Web Forms Using Server Controls.
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.
ASP.Net, Web Forms and Web Controls 1 Outline Session Tracking Cookies Session Tracking with HttpSessionState.
ASP. What is ASP? ASP stands for Active Server Pages ASP is a Microsoft Technology ASP is a program that runs inside IIS IIS stands for Internet Information.
ASP.NET 4 Unleashed Chapter 1. .aspx page: contains C# script and HTML code including tags. Listing 1.1 FirstPage.aspx.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
ASP.NET P AGE O BJECTS.  Each ASP.NET page inherits the PAGE object  The PAGE supplies 3 built in objects:  REQUEST: All information passed to the.
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.
Asp.NET Core Server Controls. Slide 2 Lecture Overview Understanding the types of ASP.NET controls HTML controls ASP.NET (Web) controls.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
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.
Raina NEC Application Object Describes the methods, properties, and collections of the object that stores information related to the entire Web.
ASP.NET WEB Applications. ASP.NET  Web application framework developed by Microsoft  Build dynamic data driven web applications and web services  Subset.
PHP: Further Skills 02 By Trevor Adams. Topics covered Persistence What is it? Why do we need it? Basic Persistence Hidden form fields Query strings Cookies.
Unit 4 Working with data. Form Element HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes, radio-buttons,
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
National College of Science & Information Technology.
Computing with C# and the .NET Framework
Internet Programming Chapter 9: State Management in ASP.NET
19.10 Using Cookies A cookie is a piece of information that’s stored by a server in a text file on a client’s computer to maintain information about.
Chapter 2 Interacting with the Customer
E-commerce Applications Development
Presentation transcript:

Web Form Fundamentals Chapter-2 Unit-2

Problem with Response. Write Spaghetti code When the individual output is to be modified the entire code is to be revised Lack of flexibility Modification of the page after a month, the entire code needs to be read and later modified Confusing content and formatting Difficulty in creating larger forms

Problem with Response. Write Complexity Tracking of different types of functionalities leads to complexity

Server Controls ASP.NET provides two sets of Server Controls HTML Server Controls Contains equivalent HTML elements Use similar HTML tags Web Controls Similar to HTML controls Provide a richer object set Variety of properties and formatting

Features of HTML control They generate their own interface The properties are set and the underlying HTML tag is updated automatically when the page is rendered and sent to the client They retain their state The web pages can be created in the same way as the windows page is created

Features of HTML control They fire events You can respond to these events just like ordinary controls in windows application

The ViewState Traditional ASP A form is submitted to the server with the filled information The Server returns back with error All the information's are lost when is page is viewed by the user

The ViewState The ASP.NET The form is submitted to the server with information The server returns the page back with error Now the page contains the information that was given at the time the page was sent to the server HOW? This is because ASP.NET maintains the viewstate

The ViewState The ViewState indicates the status of the page when submitted to the server The Status is defined through the hidden field placed on each page with a tag, the hidden fields stores information about the state Maintaining the ViewState is the default setting of the ASP.NET If you do not want to maintain the ViewState include the directive

The HTML control class The HTML server controls are available in the namespace System.Web.UI.HtmlControls

The HTML control class Class NameTag HtmlAnchor HtmlButton HtmlForm HtmlImage HtmlInputButton,

The HTML control class HtmlInputCheckbox HtmlInputControl HtmlInputFile HtmlInputHidden HtmlInputRadioButton HtmlSelect

Events Web forms are event driven means every piece of code acts in response to the specific event The HtmlButtonClass provides the Server Click event

Events Imports statement It provides access to all the important namespace Custom Page class and control variables Single event handler This event handler retrieves the value from the textbox and converts it into the respected conversion

Event handling changes Two parameters (source and e) Recommended standard for.NET It allows your code to identify the controls that sent the event Private sub convert_Serverclick(sender As Object,e as EventArgs)_ Handles convert.ServerClick

Event handling changes Second the event handler connects itself to the appropriate event using the handles clause AutoEventWireup is set to “false” so that the ASP.NET will always rely on the Handles keyword to connect to the event handlers <input type=“submit” value=“Ok” id=“convert” OnServerClick=“Convert_ServerClick” runat=“server”>

HtmlControl Classes Every html control inherits from the base class HtmlControl HtmlControl Events –ServerClick - Click is processed on the server side –ServerChange - This event reponds when a change has been made to a text or selection control

Events and Controls that provide it EventsControls that provide it ServerClickHtmlAnchor,Form,Button, InputButton,InputImage ServerChangeText,InputCheckBox, RadioButton,Select

HtmlInputImage control Click the image and the co-ordinates are to be displayed

HtmlControlBase Class Each Html control inherits from the base class HtmlControl

HtmlControl Base class PropertyDescription AttributesProvides a collection of all tag attributes and their values ControlProvides the collection of control available under current control DisabledTrue Disables the control and the user cannot interact EnableViewState True:It uses the hidden field to store the information about the page

HtmlControl Base class PropertyDescription PageProvides a reference to the web page that contains the control StyleCSS style properties that can be used to format Tag NameIndicates the name of the Html element VisibleFalse:The control is hidden from the user

HtmlContainerControl class Any html control that requires a opening and closing tag also inherits from the HtmlContainer Control - HtmlAnchor - HtmlForm - HtmlGeneric Control

HtmlContainerControl class PropertyDescription InnerHtmlHtml content between opening and closing of the tags,used for formatting,, InnertextThe text content between the opening and closing of the tags

HtmlInputControl class PropertyDescription TypeProvides the type of input control ValueReturns the content of the control as string

Page class Every web page is a custom class that inherits from the Page class

Page Class Property Fundamental PropertyDescription Application & SessionIt holds the information about the state CacheStores Objects for reuse ControlsProvides a collection of the web controls in that Page EnableViewState

Page Class Properties Fundamental PropertyDescription IsPostBackBoolean Property checks whether the Page is submitted for the first time RequestRefer to the HttpRequest object that holds the information about the current web request ResponseSet the web response or redirect the user to other web page

Page Class Properties Fundamental PropertyDescription ServerRefers to the HttpServer utility performs some tasks like URL,Html encoding UserIf the user has been authenticated then this property will be initialized with the user information

HttpRequest class The HttpRequest class encapsulates all the information related to the client request for a web page

HttpRequest class PropertyDescription ApplicationPathGets the virtual directory (URL) PhysicalPathGets the real directory (URL) BrowserProvides link to the HttpBrowserCapabilities object which contains the browser features ClientCertificateGets the security certificate if there exists one

HttpRequest class PropertyDescription CookiesGets the collection cookies sent with the request Headers\ Servervariables Provides a name\value collection of HTTP headers and server variables IsAuthenticated IsSecureConnection Returns true if user is authenticated and secure sockets are used

HttpRequest class PropertyDescription QueryStringProvides the parameters that were passed along with query string Url and UrlReferrer Current address of the page and the address of the page from where the user has navigated from UserAgentA string representing the browser type.IE provides the value “MSIE”

HttpRequest class PropertyDescription UserLanguagesProvides a sorted string array that lists the clients language

Server Variables Request Method Server Name Server Port Server Protocol Server Software

The HttpResponse Class This class allows you to send information directly to the client Some of the important functionalities Caching Support Cookie features Redirect method

PropertyDescription BufferOutputDefault set to (true) the page is not sent to the client CacheRefers to the HttpCache policy CookiesThe collection of cookies sent with response Write(), BinaryWrite() WriteFile() Allows you to write text or binary content directly to the response stream

PropertyDescription Redirect()Transfers the user to another page or another website

The Server Utility Class The ServerUtility class provides some miscellaneous helper methods

PropertyDescription CreateObjectCreates an instance of the COM object that is identified by its ID HtmlEncode, HtmlDecode Changes an ordinary string into a string with legal HTML characters UrlEncode, UrlDecode Changes an ordinary string into a string with legal URL characters

PropertyDescription MapPathReturns the Physical path TransferSimilar to response.redirect method