ASP.NET 2.0. What is ASP.NET is a server-side scripting language developed by Microsoft is the next generation of ASP (Active Server Pages), completely.

Slides:



Advertisements
Similar presentations
11 ASP.NET Slides based off:. 22 B ACKGROUND - W EB A RCHITECTURE Web Server PC/Mac/Unix/... + Browser Client Server Request:
Advertisements

Languages for Dynamic Web Documents
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
ASP Tutorial. What is ASP? ASP (Active Server Pages) is a Microsoft technology that enables you to make dynamic and interactive web pages. –ASP usually.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Introduction to ASP.NET
1 Chapter 20 — Creating Web Projects Microsoft Visual Basic.NET, Introduction to Programming.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Chapter 9 Web Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
INTRODUCTION TO WEB DATABASE PROGRAMMING
9-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
1 Creating Web Forms in HTML Web forms collect information from customers Web forms include different control elements including: –Input boxes –Selection.
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 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
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.
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.
HTML, GUI, ASP.NET Rina Zviel-Girshin Lecture 2
ASP.NET INTRODUCTION INTO وزارة التربية و التعليم العالي كلية العلوم و التكنولوجيا قسم علوم الحاسوب و تكنولوجيا المعلومات اعداد الاستاذ: عبد الله محمد.
An Introduction to ASP.NET Ed Dunhill blogs.msdn.com/edunhill SLIDE7.
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.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
ASP.Net Web Applications. Characteristics of a typical data driven web application Web Server HTML Graphics Active-X Java Applets HTTP Request ADO / JDBC.
ASP.NET Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours Digital.
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.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
Introduction to ASP.NET 1www.tech.findforinfo.com.
CSCI 6962: Server-side Design and Programming Introduction to Active Server Pages.
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.
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Programming with Visual Web Developer Chapter 9.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
ASP.NET Presented by Pan Gao. ASP.NET Next generation of ASP Next generation of ASP Program Language to build web application Program Language to build.
CIS 375—Web App Dev II ASP.NET 7 Binding (based on w3schools.com— also see MSDN.NET developmentMSDN.NET development.
Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part.
Overview of Previous Lesson(s) Over View  SDI programs  The Application Wizard can generate single-document interface (SDI) applications that work.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
USING XML AS A DATA SOURCE. Data binding is a process by which information in a data source is stored as an object in computer memory. In this presentation,
Active Server Pages (ASP), also known as Classic ASP or ASP Classic, was Microsoft's first server-side script engine for dynamically generated web pages.
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.
1 HTML Forms
Chapter 4: Working with ASP.NET Server Controls OUTLINE  What ASP.NET Server Controls are  How the ASP.NET run time processes the server controls on.
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,
CIS 375—Web App Dev II ASP.NET 9 Database. 2 ADO.NET What is ADO.NET? ADO.NET is a part of the.NET Framework ADO.NET consists of a set of classes used.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
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. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
CIS 375—Web App Dev II ASP.NET 4 Server Controls.
CIS 375—Web App Dev II ASP.NET 5 Events. 2 The Page_Load Event The Page_Load event is triggered when a page loads. [Example]Example Sub Page_Load lbl1.Text="The.
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.
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.
Active Server Pages v.s. Java Server Pages Presenters: Lan Guo Qunying Fan Pei-Xun Wu Date:
Computing with C# and the .NET Framework
Haritha Dasari Josue Balandrano Coronel -
Unit 4: The Server Tier (18 Hrs
Chapter 23 – ASP.NET Outline 23.1 Introduction NET Overview
Web Development in Microsoft Visual Studio 2013
Web Development Using ASP .NET
Web Development Using ASP .NET
Presentation transcript:

ASP.NET 2.0

What is ASP.NET is a server-side scripting language developed by Microsoft is the next generation of ASP (Active Server Pages), completely new technology, not backward compatible to classic ASP is part of Microsoft.Net framework runs inside IIS (Internet Information Server) version history: ASP.NET, ASP.NET 2.0, ASP.NET 3.0 an ASP.NET file has the extension “.aspx” as opposed to “.asp” as in classic ASP the execution and role of “.aspx” files is the same as in other server-side languages like JSP, PHP, etc.

Microsoft.Net Framework Microsoft.Net framework is an environment for building, deploying and running web-based and standalone enterprise applications it contains the following components: programming languages: C#, Visual Basic.Net, J# server technologies and client technologies: ASP.NET, Windows Forms (Windows desktop solutions), Compact Framework (PDA/Mobile solutions) development environments: Visual Studio.Net, Visual Web Developer

Differences between ASP.NET and ASP ASP.NET has a new set of programmable controls, XML-based components, increased performance by running compiled code, event-driven programming ASP.NET uses ADO.NET for accessing databases, supports full Visual Basic, not VBScript, supports C#, C++ and JScript ASP.NET has a large set of HTML controls which can be controlled by scripts ASP.NET contains a new set of programmable object- oriented input controls all ASP.NET objects on a web page can expose events that can be processed by ASP.NET code

Running ASP.NET for running ASP.NET code only:.NET Framework and IIS (Microsoft Internet Information Server) is required the principle of running ASP.NET code is the same as in running other server-side scripts like PHP and JSP

First.aspx example in classic ASP (and also available in ASP.NET), ASP code is inserted in html code inside the tags “ ”

ASP.NET Server Controls in ASP.NET, ASP code is not placed entirely inside the html code, but instead is written in separate executable files server controls are tags understood and run by the server there are three kinds of server controls: HTML Server Controls - Traditional HTML tags Web Server Controls - New ASP.NET tags Validation Server Controls - For input validation

HTML Server Controls html elements in ASP.NET files are, by default, treated as text. To make these elements programmable a runat="server" attribute to the html element is required. This attribute indicates that the element should be treated as a server control. The id attribute is added to identify the server control. all html server controls must be within a tag with the runat="server" attribute. The runat="server" attribute indicates that the form should be processed on the server. It also indicates that the enclosed controls can be accessed by server scripts.

HTML Server Control example Sub Page_Load link1.HRef=" End Sub Visit Google!

Web Server Controls are special tags understood by the server, but they do not map to any existing HTML element they require a runat=“server” attribute to work ex.: Sub submit(Source As Object, e As EventArgs) button1.Text="You clicked me!" End Sub

Validation Server Controls are used to validate user input; if the user input does not pass validation, it will display an error message each validation control performs a specific type of validation ex.: Enter a number from 1 to 100:

Event handlers ex. Page_Load event handler: Sub Page_Load lbl1.Text="The date and time is " & now() End Sub

ASP.NET Web Forms all server controls must be defined within a tag and this should have the attribute runat=“server” there can be only one control on a web page the form is always submitted to the page itself regardless of the action attribute the method is set to POST by default if not specified, name and id attribute are automatically assigned by ASP.NET

ASP.NET ViewState ASP.NET maintains a ViewState (containing all the values of the fields in the form) as a hidden field in the page like this: this is useful when the frame is submitted to the server with an error and you have to go back and correct the input data on the form maintaining the ViewState is the default setting for Web forms; this can be changed with the directive:

asp:TextBox Sub change(sender As Object, e As EventArgs) lbl1.Text="You changed text to " & txt1.Text End Sub Enter your name:

asp:Button Sub submit(sender As Object, e As EventArgs) lbl1.Text="Your name is " & txt1.Text End Sub Enter your name:

Data binding controls some controls can be bind to a datasource like a database, an xml file or a script the data binding list controls are: asp:RadioButtonList asp:CheckBoxList asp:DropDownList asp:ListBox these controls can contain or they can use the items from a data source

Binding an ArrayList to a asp:RadioButtonList Sub Page_Load if Not Page.IsPostBack then dim mycountries=New ArrayList mycountries.Add("Norway") mycountries.Add("Sweden") mycountries.Add("France") mycountries.Add("Italy") mycountries.TrimToSize() mycountries.Sort() rb.DataSource=mycountries rb.DataBind() end if end sub

Binding an xml file to a asp:RadioButtonList sub Page_Load if Not Page.IsPostBack then dim mycountries=New DataSet mycountries.ReadXml(MapPath("countries.xml")) rb.DataSource=mycountries rb.DataValueField="value" rb.DataTextField="text" rb.DataBind() end if end sub sub displayMessage(s as Object,e As EventArgs) lbl1.text="Your favorite country is: " & rb.SelectedItem.Text end sub

Creating a Database Connection using ADO.NET sub Page_Load dim dbconn dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & server.mappath("northwind.mdb")) dbconn.Open() end sub

Creating a Database Command sub Page_Load dim dbconn,sql,dbcomm dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & server.mappath("northwind.mdb")) dbconn.Open() sql="SELECT * FROM customers" dbcomm=New OleDbCommand(sql,dbconn) end sub

Creating a DataReader sub Page_Load dim dbconn,sql,dbcomm,dbread dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & server.mappath("northwind.mdb")) dbconn.Open() sql="SELECT * FROM customers" dbcomm=New OleDbCommand(sql,dbconn) dbread=dbcomm.ExecuteReader() end sub

Binding a Datasource to a control sub Page_Load dim dbconn,sql,dbcomm,dbread dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & server.mappath("northwind.mdb")) dbconn.Open() sql="SELECT * FROM customers" dbcomm=New OleDbCommand(sql,dbconn) dbread=dbcomm.ExecuteReader() customers.DataSource=dbread customers.DataBind() dbread.Close() dbconn.Close() end sub Companyname Contactname Address City