CIS 451: ASP.NET Objects Dr. Ralph D. Westfall January, 2009.

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

23-Aug-14 HTML/XHTML Forms. 2 What are forms? is just another kind of XHTML/HTML tag Forms are used to create (rather primitive) GUIs on Web pages Usually.
24-Aug-14 HTML Forms. 2 What are forms? is just another kind of HTML tag HTML forms are used to create (rather primitive) GUIs on Web pages Usually the.
JavaScript Forms Form Validation Cookies. What JavaScript can do  Control document appearance and content  Control the browser  Interact with user.
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
JavaScript Forms Form Validation Cookies CGI Programs.
USER INTERACTIONS: FORMS
ASP.NET Programming with C# and SQL Server First Edition
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Using Entities & Creating Forms Jill R. Sommer Institute for Applied Linguistics Kent State University.
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.
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
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.
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.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Advance Database Management Systems Lab no. 5 PHP Web Pages.
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)
CO1552 Web Application Development HTML Forms. Websites can be made more interactive by providing facilities for users to provide data To get user entered.
INTERNET APPLICATION DEVELOPMENT For More visit:
CIS 451: ASP.NET Debugging and Server-Side Includes Dr. Ralph D. Westfall February, 2009.
JavaScript & jQuery the missing manual Chapter 11
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.
ASP.NET Dr. Ralph Westfall May, Web Development Problem HTML designed to display static pages only interactive when user clicks links  can’t provide.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
IT533 Lectures Session Management in ASP.NET. Session Tracking 2 Personalization Personalization makes it possible for e-businesses to communicate effectively.
The Document Object Model. Goals Understand how a JavaScript can communicate with the web page in which it “lives.” Understand how to use dot notation.
Robinson_CIS_285_2005 HTML FORMS CIS 285 Winter_2005 Instructor: Mary Robinson.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
CSC 2720 Building Web Applications HTML Forms. Introduction  HTML forms are used to collect user input.  The collected input is typically sent to a.
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.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
Website Development with PHP and MySQL Saving Data.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
HTML FORMS GET/POST METHODS. HTML FORMS HTML Forms HTML forms are used to pass data to a server. A form can contain input elements like text fields, checkboxes,
HTML Form Widgets. Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back.
Introduction to JavaScript CS101 Introduction to Computing.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
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.
HTLM Forms CS3505. Form Handling in Browser html User Files out form WEbBROWSErWEbBROWSEr User read response submit Get URL?input html Get file html script.
CIS 451: Cookies Dr. Ralph D. Westfall February, 2009.
Creating Databases for Web applications Server side vs client side PHP basics Homework: Get your own versions of sending working: both html and Flash!
+ FORMS HTML forms are used to pass data to a server. begins and ends a form Forms are made up of input elements Every input element has a name and value.
 Previous lessons have focused on client-side scripts  Programs embedded in the page’s HTML code  Can also execute scripts on the server  Server-side.
©SoftMooreSlide 1 Introduction to HTML: Forms ©SoftMooreSlide 2 Forms Forms provide a simple mechanism for collecting user data and submitting it to.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Basic ActionScript and PHP Cis 126. Getting Started set up a basic folder structure so we can keep our files organized. Mirror this structure on your.
January 27, 2001ASP Basics1 Active Server Pages (ASP) Basics The client/server model Objects Forms Active Server Pages VBScript Lab and Homework.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Project 6: Creating XHTML Forms Kelly.
HTML Tutorial. What is HTML HTML is a markup language for describing web documents (web pages) HTML documents are described by HTML tags Each HTML tag.
Lesson 5 Introduction to HTML Forms. Lesson 5 Forms A form is an area that can contain form elements. Form elements are elements that allow the user to.
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,
FORMS Explained By: Jasdeep Kaur. Lecturer, Department of Computer Application, PGG.C.G., Sector: 42, Chandigarh.
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
Ashima Wadhwa Java Script And Forms. Introduction Forms: –One of the most common Web page elements used with JavaScript –Typical forms you may encounter.
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Section 17.1 Section 17.2 Add an audio file using HTML
Introducing Forms.
Forms, cont’d.
PHP-II.
Intro to Programming (in JavaScript)
Presentation transcript:

CIS 451: ASP.NET Objects Dr. Ralph D. Westfall January, 2009

Object Oriented Programming many popular newer programming languages are object-oriented C++, Java, JavaScript Visual Basic.NET is a true object- oriented (OO) language in contrast to VB 6 (which however did have objects with very useful properties)

What Is an Object? 3 types of things grouped together properties (like variables: descriptive) like a "super" variable (cf. hours PM) methods (like functions: actions) events (things that it responds to) similarities with real world objects car (properties? methods? events?) dog " "

Object Features properties: name/value pairs age = 21; height = 66"; weight = 135#; methods: code that does something calculations, write to screen, send may have either/both of following: parameters (inputs) return values (outputs)

Object Features - 2 events: things happen, object responds to them like a method, but triggered externally user clicks a button, or time runs out can have parameters and/or return values asynchronous: can occur at any time rather than scheduled, or at same time as something else (synchronous)

Other Object Concepts class = template or general model instance of class has specific attributes telephone = class, my phone = instance encapsulation: details of object hidden inside a "black box" only need to know the interface: how to call the methods and what the inputs and/or outputs are

Other Object Concepts - 2 "dot" notation identifies attributes and methods of objects Request.TotalBytes Request.QueryString.Count Count (of arguments) in QueryString is a property of Request Object Response.Write() Write is a method of Response Object

ASP Core Objects Request: messages from caller (e.g., web page or process) Response: messages to caller (browser) Server: variables and utility functions Application: data storage in memory for all web pages in the application Session: identifies individual user interactions

Request Object html or another asp file requests an asp file Request Object has information from page that requested the asp file information is stored in "collections" contain pairs of variable names and their values (name/value pairs) data values can be accessed by item name Request.QueryString("page")

Request Object Data "get" method in HTML calling page "get" appends data to URL (URL encoding) limit around 1000 characters (256 – 2000+) data available in Request.QueryString "collection," indexed by name of form element Request.QueryString("page") form has textbox, textarea, checkbox, radio button, or etc. element with name="page"

URL Encoding ? after URL shows start of data pairs of: name=value & (ampersands) between pairs + between separate words (= space) special characters coded as %nn (+ is %2B) …?cust=Jabbar&address=231+10th+St example: try doing a Yahoo searchYahoo

Request Object Data - 2 "post" method in HTML calling page sends data by a separate route size is essentially unlimited data available through Request.Form "collection," indexed by name of form element Request.Form("prod1") form has textbox, textarea, checkbox, radio button, or etc. element with name="prod1"

Get versus Post get (Request.QueryString) [object.property]) better for debugging (can look at query string in URL box on browser) post (uses Request.Form) can handle more data safer (less susceptible to hacking) always use post for database updates easy to convert Request.QueryString to Request.Form with global search/replace

Using QueryString in an aspx File can create the same effect sending from an aspx file as from a html file Response.Redirect("rsp.aspx?Name=" & _ this.txtName.Text & "&LastName=" & _ this.txtLastName.Text) values are URL encoded and visible in browser address of destination page one way to migrate from html to aspx

Response Object sends information to client can control when and how to send it can control caching/expiration of page can send parts or all of a web page to client

Response Methods Response.Write(x1 [& " " & x2 [&...]]) x1 etc. can be anything printable (text, #s, etc., or functions that return printable characters).NET has parentheses hold argument(s) same effect as Response.Write, in less space less efficient (don't use <%= a lot)

Response Methods - 2 redirecting to another page Response.Redirect("buya.aspx") stops processing on current page and goes to the other page can go to external pages too

Server Transfer Method can also use to redirect to another page, but only if it's on same server Server.Transfer("buya.aspx") doesn't change URL in browser address comparison of Response.Redirect and Server.Transfer comparison

Exercise: Form Processing use Dreamweaver to create a form that uses 8+ form elements/variations in its Windows>Objects>Forms toolbar set name property for each element select options (e.g., text input can be single or multiline, or password) see HTML Form Reference for syntaxHTML Form Reference save file as a.html file

Exercise: Form Processing - 2 use Visual Studio to create a project add the.html file you created on the previous page to the project create a.aspx file with Response.Write statements to print inputs/selections from each input element from the.html file test it on your workstation or computer

Multiple Selection Data can allow multiple selections in a list box on a form Paris Sydney Buenos Aires may send multiple items with same name ("loc" in this example)

Multiple Selection Data - 2 For intI = 1 to _ Request.Form("loc").Count Response.Write _ (Request.Form("loc")(intI)) Next note dot connecting Form object's ("loc") item to Count