ASP/ASP.NET: Tricks and Tips How to get Microsoft’s Programming Language to work for you By Wade Tripp Park University

Slides:



Advertisements
Similar presentations
E-Commerce CMM503 – Lecture 8 Stuart Watt Room C2.
Advertisements

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.
1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
Web Forms and ASP.NET Programming Right from the Start with Visual Basic.NET 1/e 12.
IIS Technologies.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Building Applications using ASP.NET and C# / Session 1 / 1 of 21 Session 1.
Server-Side vs. Client-Side Scripting Languages
1 Chapter 12 Working With Access 2000 on the Internet.
Session 6 Server-side programming - ASP. An ASP page is an HTML page interspersed with server-side code. The.ASP extension instead of.HTM denotes server-side.
Introduction to ASP.NET. 2 © UW Business School, University of Washington 2004 Outline Static vs. Dynamic Web Pages.NET Framework Installing ASP.NET First.
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
1 Active Server Pages Active Server Pages (ASPs) are Web pages ASP = server-side scripts + HTML The appearance of an Active Server Page depends on who.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models.
 What I hate about you things people often do that hurt their Web site’s chances with search engines.
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.
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
INTRODUCTION TO WEB DATABASE PROGRAMMING
JavaScript & jQuery the missing manual Chapter 11
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
3/8/00asp00 1 Active Server Pages from Microsoft Nancy McCracken Northeast Parallel Architectures Center at Syracuse.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Introduction to JavaScript + More on Interactive Forms.
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.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
Tutorial 7 Creating Forms. Objectives Session 7.1 – Create an HTML form – Insert fields for text – Add labels for form elements – Create radio buttons.
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.
Universiti Utara Malaysia Chapter 3 Introduction to ASP.NET 3.5.
The Web Architecture and ASP.NET. Slide 2 Review of the Web (1) It began with HTTP and HTML, which delivers static Web pages to browsers which would render.
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.
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.
ASP.NET The Clock Project. The ASP.NET Clock Project The ASP.NET Clock Project is the topic of Chapter 23. By completing the clock project, you will learn.
7 Chapter Seven Client-side Scripts. 7 Chapter Objectives Create HTML forms Learn about client-side scripting languages Create a client-side script using.
Introduction to JavaScript CS101 Introduction to Computing.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
The Problem of State. We will look at… Sometimes web development is just plain weird! Internet / World Wide Web Aspects of their operation The role of.
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!
 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.
Scripting Languages Client Side and Server Side. Examples of client side/server side Examples of client-side side include: JavaScript Jquery (uses a JavaScript.
COMP3241 E-Commerce Technologies Richard Henson University of Worcester November 2014.
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-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
1) PHP – Personal Home Page Scripting Language 2) JavaScript.
Unit 1 – Web Concepts Instructor: Brent Presley.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
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.
ASP.NET WEB Applications. ASP.NET  Web application framework developed by Microsoft  Build dynamic data driven web applications and web services  Subset.
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,
Active Server Pages v.s. Java Server Pages Presenters: Lan Guo Qunying Fan Pei-Xun Wu Date:
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Tonga Institute of Higher Education IT 141: Information Systems
Section 6.3 Server-side Scripting
Active Server Pages ASP.Net
PHP / MySQL Introduction
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Tutorial 10: Programming with javascript
Presentation transcript:

ASP/ASP.NET: Tricks and Tips How to get Microsoft’s Programming Language to work for you By Wade Tripp Park University

Disclaimer I am not an expert in all the details, just giving a general overview of how it works, and there are over a dozen ways how to do things, with half of them working.

Who are YOU?

History of ASP (abbreviated) VBScript –Client Side –Possible for all sorts of problems, intentional or not –Required the client to have IE installed

History of ASP (abbreviated) ASP –Server Side Scripting –Browser independent –Required special server software but….. –Very much interpreted and scripting –Created many bad programming habits

History of ASP (abbreviated) ASP.NET –Server Side Scripting –Able to program in many languages –Permits good programming practice but…. –Steep learning curve

How ASP works Browser requests a web page Web server gets request and loads file from hard drive Web server sends the file to asp.dll to process Returns to the browser the processed page

How ASP.NET works (interpreted) Browser requests a web page Web server gets request and loads the file from hard drive Web server sends the file to aspnet_isapi.dll to process Returns to the browser the processed page

How ASP.NET works (compiled) Browser requests a web page Web server gets request and loads dll from hard drive Web server sends the file to aspnet_isapi.dll to process Returns to the browser the processed page The code does not have to be on the server

Differences between ASP ASP Quick and easy to use and do Easy to modify and tweak Uses the very basics and forgiving ASP.NET (Interpreted) Increased flexibility No need to code everything from scratch Memory of events Still can get confusing for large projects ASP.NET (Compiled) Most flexible Hardest to understand Easy to get good programming standards

Differences between ASP Simple and quick – ASP Ex – Date modified, Alert Message Repeated on several pages – ASP.NET Interpreted Ex – Announcement on several web pages Advanced Application – ASP.NET Compiled Ex – Registration form

Getting down to code ASP/ASP.NET handles the appearance, input/output of a web page The Code Behind focuses on the thinking and language “Code Behind” can happen in a web page itself and does not have to be in a.vb or.cs file Any language can use in theory, VB and C# are the ones Microsoft has preconnected in Visual Studio, but almost any can be used. Java is not used for various legal reasons.

Simple Displaying Stuff To simply display stuff ( traditionally used in ASP ) you use ASP is forgiving, so if you miss the ( ) in Response.Write, it has variant type and other items. But if you save it as.aspx it may not work.

Is.asp the same as.aspx No, but they are so close that most of the time you can just do minor changes and tweaks going from asp to aspx. Several things are required (Declaration of variables) The big change with CDONTS. The method for sending out mail was changed from ASP to ASP.NET IIS 5 to IIS 6 for various reasons [Security being the main one]

QueryString vs. Forms There are two ways to get information. QueryString/Get –Information is sent via the URL Form/Post –Information sent in the page

QueryString It appears in the URL.. /index.asp?Sample=test&B1=Submit The ? Marks the end of the URL and the rest are variables Items are recoded for valid characters (make spaces into +, & turned into %26 and other items) Advantage jump directly to section, performing items

QueryString Disadvantages Easily find the information via History and guessable test.asp?ID=45 Limited on how much information can be passed. Dependant on browser of 1000, characters

Form What is normally used with web pages Better to make things go better and organized, less chance of being reviewed

Actually using it <% Dim intNumber as integer intNumber = Request.QueryString(“Test”) intNumber = Request.Form(“Test”) Response.Write (intNumber) %>

TIP - Polish Notation Based on ideas of Jan Lukasiewicz Standard documenting is putting type in front of name intName – Integer strName – String bolName – Boolean values

TIP - Polish Notation Also good for ASP txtName – Textbox lblName – Label panName – Panel lstName – List …. It keeps you organized

Basics of ASP.Net When it is transformed by the compiler it becomes What all happened? ASP.NET is transformed into HTML

How does information get stored Information is stored in a hidden view, called the Viewstate It sends and organizes the information for each variable and items The information is stored for all server objects

TIP – Don’t make everything label Each ASP.NET item requires resources Don’t use labels for standard items. Why? Because it takes extra resources and time to download

TIP – Don’t make everything label Each ASP.NET item requires resources Don’t use labels for standard items. Why? Because it takes extra resources and time to download

TRICKS – Storing information Information can be handled Session Application Variable Value of ASP Object Hidden Field Passed Variable in Form

TRICKS – Database Reading Can connect to database via connection with SQL, Access, Informix, etc… anything that permits ODBC Warning – Access can cause problems with older web servers

TRICKS – AutoPostback Permits scripting to run after an item has been altered Requires Javascript

TRICKS – Validation Lets a user check to make sure a field is probably filled out Normally uses Javascript to validate There are a few ways around it (disable Javascript)

TRICKS – Smart Navigation Permits forms not to blink by using ‘IFRAME’

TRICKS – ME - ASP Used to find what variables and objects are used Remove the Me. after you go though the form