Course Textbook: Build Your Own ASP.Net Website: Chapter 2

Slides:



Advertisements
Similar presentations
MWD1001 Website Production Using JavaScript with Forms.
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
 Copyright Wipro Technologies JSP Ver 1.0 Page 1 Talent Transformation Java Server Pages.
The Web Warrior Guide to Web Design Technologies
Chapter 51 Scripting With JSP Elements JavaServer Pages By Xue Bai.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic JavaScript: Introduction to Scripting.
Razor. Slide 2 Remember this? Browser Web Server HTTP Request HTTP Response (Web page / code) Client code (script) Interpret request Generate HTML and.
1 Chapter 12 Working With Access 2000 on the Internet.
Tutorial 10 Programming with JavaScript
DT228/3 Web Development JSP: Directives and Scripting elements.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
Chapter 14 Introduction to HTML
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
CST JavaScript Validating Form Data with JavaScript.
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.
INTRODUCTION TO WEB DATABASE PROGRAMMING
4.1 JavaScript Introduction
Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Chapter 11 Cascading Style Sheets: Part I The Web Warrior Guide to Web Design Technologies.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Chapter 3 Working with Text and Cascading Style Sheets.
Scott Marino MSMIS Summer Session Web Site Design and Authoring Session 9 Scott Marino.
Tutorial 14 Working with Forms and Regular Expressions.
CS346 - Javascript 1, 21 Module 1 Introduction to JavaScript CS346.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Project Four Forms Discuss form processing Describe the difference between client-side and server-side form processing Add a horizontal rule to a Web page.
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
WORKING WITH XSLT AND XPATH
Advanced Web Design Scripting Tutorial Chapters. Scripting Intro The scripting part of the forthcoming Advanced Web Design textbook introduces you to.
E-Commerce: Introduction to Web Development 1 Dr. Lawrence West, Management Dept., University of Central Florida Topics What is a Web.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
Website Development & Management Creating Web Pages CIT Fall Instructor: John Seydel, Ph.D.
XP Dreamweaver 8.0 Tutorial 3 1 Adding Text and Formatting Text with CSS Styles.
Client Scripting1 Internet Systems Design. Client Scripting2 n “A scripting language is a programming language that is used to manipulate, customize,
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
Chapter 8 Cookies And Security JavaScript, Third Edition.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
CMPS 211 JavaScript Topic 1 JavaScript Syntax. 2Outline Goals and Objectives Goals and Objectives Chapter Headlines Chapter Headlines Introduction Introduction.
© 2010 Delmar, Cengage Learning Chapter 8 Collecting Data with Forms.
Tutorial 10 Programming with JavaScript
VB and C# Programming Basics. Overview Basic operations String processing Date processing Control structures Functions and subroutines.
JavaScript - A Web Script Language Fred Durao
1 HTML Forms
JavaScript Syntax, how to use it in a HTML document
JavaScript Scripting language What is Scripting ? A scripting language, script language, or extension language is a programming language.
XP Tutorial 8 Adding Interactivity with ActionScript.
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 4 Unleashed Chapter 1. .aspx page: contains C# script and HTML code including tags. Listing 1.1 FirstPage.aspx.
Tutorial 3 Adding and Formatting Text with CSS Styles.
Introduction to HTML. _______________________________________________________________________________________________________________ 2 Outline Key issues.
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 – Active Server Pages ASP.NET is a server-side technology for developing web applications based on the.NET Framework.
1 Lesson 6 Introducing JavaScript HTML and JavaScript BASICS, 4 th Edition.
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
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.
1 Introducing Web Developer Tools Rapid application development tools ASP.NET-compatible web editors –Visual Studio.NET Professional Edition –Visual Studio.
Chapter 1 Getting Started with ASP.NET Objectives Why ASP? To get familiar with our IDE (Integrated Development Environment ), Visual Studio. Understand.
Section 10.1 Define scripting
Getting Started with CSS
Florida Gulf Coast University
Tutorial 10: Programming with javascript
Presentation transcript:

Course Textbook: Build Your Own ASP.Net Website: Chapter 2 ASP.Net Basics Course Textbook: Build Your Own ASP.Net Website: Chapter 2

Lesson Objectives Introduces more advanced ASP.Net topics such as: ASP.Net Page Structure ASP.Net Server Controls Directives View State Namespaces

ASP.Net Page Structure An ASP.Net page consists of the following elements: Directives Code declaration blocks Code render blocks ASP.Net server controls Server-side comments Server-side include directives Literal text and HTML tags Not every element always appears on a given page, we will learn when to use them

Directives Control how the page is compiled Specify settings when transferring between pages Aid in debugging Allow importing of classes Start with the <@ sequence and end with a %> sequence ASP.Net directives can appear anywhere on the page, but are usually placed as the first lines in the file

Three Common Directives The Page directive defines page-specific attributes like the language to be used as in: <%@ Page Language=“C#” %> The Import directive makes functionality defined elsewhere through the use of namespaces as in: <%@ Import Namespace=“System.Web.Mail” %> The Register directive links a user control to the ASP.Net page as in: <%@ Register TagPrefix=“ux” TagName=“footer” Src=“footer.ascx” %>

Code Declaration Blocks When you add programming logic to your .aspx page, it resides inside a <script runat=“server”> tag Code declaration tags usually are placed in the <head> of your ASP.Net page If you don’t specify the language of the code, it will default to the language in the Page directive <script runat=“server” language=“C#”>

Code Render Blocks Used to define inline code or inline expressions <% String Title = “Harry Potter”; %> <% Title %> The first line contains a complete line of C# code, the declaration and assignment of a String variable The second line writes out the Title variable onto the page

ASP.Net Server Controls Server Controls represent the dynamic elements users interact with. There are four types of server controls: HTML Controls ASP.Net Controls Validation Controls User Controls Most server controls must reside within a <form runat=“server> tag

Advantages of Server Controls HTML elements can be accessed from within code to change their characteristics, check their values, or dynamically update them ASP.Net controls retain their properties even after the page was processed. This process is called the View State With ASP.Net controls, developers can separate the presentational elements and the application logic so they can be considered separately

What is the View State??? The persistence of data after it is sent to the server for processing is possible because of the View State If you have created forms using HTML controls, you have experienced the loss of data after form submission The data is maintained in the view state by encrypting it within a hidden form field

ing at the View State Look at the source code of the file after the page has been submitted to see code similar to this… i.e. <input type= hidden” name=“VIEWSTATE” value=“dWtMTcy0TAy0DawNzt)PDtsPGk6Mj47PjtsPHQ802w8aTWzPj+02wPGw5uAXJdGFaGaxk6t4=“ /> The View State is enabled for every page by default If you don’t intend to use the View State, set the EnableViewState property of the Page directive to be false <%@ Page EnableViewState=“False” %>

Server-Side Comments Server-side comments will not be processed by ASP.Net It used the <%-- beginning sequence and the --%> ending sequence <% -- This is a server-side comment --%> The difference between HTML comments and ASP.Net comments is that ASP.Net comments are processed by the browser or the ASP.Net runtime Don’t use HTML comments to comment out ASP.Net code HTML comments only hide things from the browser

Server-Side Include Directives These includes help developers insert segments of code into a page from an external file There are two techniques for doing this: Using the file attribute, we give the physical path to the file on the server either as an absolute path starting from the drive letter or a relative path to the current file <! -- include file=“myinclude.aspx” --> (relative path) Using the virtual attribute, you can specify the file’s location from the absolute root of the site, or from a relative path to the current page. <! -- include virtual=“/directory1/myinclude.aspx” --> (absolute path

Literal Text and HTML Tags One cannot do without text and HTML elements to display information from your ASP.Net controls and programming code Without these there would be no format to the page The surrounding <html>, <head>, and <body> tags make it possible for a browser to understand our page

Languages .Net supports many different languages Programmers used to VBScript or JavaScript to do their programming will have more robust, strongly-typed, and feature-rich choices in VB.Net and C#.Net VB.Net builds on the RAD that became popular in the 90’s. VB.Net is easy to read, use and maintain. C#.Net was developed to keep the simplicity of VB and the power and flexibility of C++ (some say to replace Java). C# does away with confusing C++ syntax.

Summary On an ASP.Net page, you will probably use: directives, code declaration blocks, code render blocks, includes, comments, and controls. Two languages supported by ASP.Net are VB.Net and C#.Net. We will focus on C#.Net syntax for this course. In the next chapter we will cover some C# programming basics.