CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr

Slides:



Advertisements
Similar presentations
Unit 02. ASP.NET Introduction HTML & Server controls Postbacks Page Lifecycle.
Advertisements

Web Forms and ASP.NET Programming Right from the Start with Visual Basic.NET 1/e 12.
Asp.NET Core Server Controls. Slide 2 Lecture Overview Understanding the types of ASP.NET controls HTML controls ASP.NET (Web) controls.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Performed by:Gidi Getter Svetlana Klinovsky Supervised by:Viktor Kulikov 08/03/2009.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
ASP.NET Programming with C# and SQL Server First Edition
ASP.NET
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College Lecture 8: WebForms — Web-based.
Chapter 9 Web Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
JavaScript & jQuery the missing manual Chapter 11
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.
HTML, GUI, ASP.NET Rina Zviel-Girshin Lecture 2
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
An Introduction to ASP.NET Ed Dunhill blogs.msdn.com/edunhill SLIDE7.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
ASP.NET  ASP.NET is a web development platform, which provides a programming model, a comprehensive software infrastructure and various services required.
Beginning Web Site Development Module 1 – Dynamic Web Site Development Fundamentals of building dynamic Web sites with ASP.NET 2.0 and C# Version.
Programming with Microsoft Visual Basic 2012 Chapter 12: Web Applications.
ASP.Net Web Applications. Characteristics of a typical data driven web application Web Server HTML Graphics Active-X Java Applets HTTP Request ADO / JDBC.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 4-1 of…
Creating Web Applications Using ASP.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
ASP.NET Web Server Controls Basic Web Server Controls.
© Minder Chen, ASP.NET 2.0: Introduction - 1 ASP.NET 2.0 Minder Chen, Ph.D. Framework Base Class Library ADO.NET: Data & XML.
ASP.NET Controls. Slide 2 Lecture Overview Identify the types of controls supported by ASP.NET and the differences between them.
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.
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.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
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.
Database Handling, Sessions, and AJAX. Post Back ASP.NET Functionality The IsPostBack method in ASP.NET is similar to the BlackBerry.refresh method –IsPostBack.
Module 4: Creating a Microsoft ASP.NET Web Form. Overview Creating Web Forms Using Server Controls.
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,
ASP.NET 4 Unleashed Chapter 1. .aspx page: contains C# script and HTML code including tags. Listing 1.1 FirstPage.aspx.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Asp.NET Core Server Controls. Slide 2 Lecture Overview Understanding the types of ASP.NET controls HTML controls ASP.NET (Web) controls.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
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.
Sergey Sidorov PhD student, computer software chair Computer Science department.
 Lecture  Website language: ASP.net  Book name Beginning ASP.NET 4 in C# and VB 2.
ASP.NET Architecture Mike Taulty Developer & Platform Group Microsoft Ltd
111 State Management Beginning ASP.NET in C# and VB Chapter 4 Pages
Chapter 1 Getting Started with ASP.NET Objectives Why ASP? To get familiar with our IDE (Integrated Development Environment ), Visual Studio. Understand.
2nd year Computer Science & Engineer
Computing with C# and the .NET Framework
ASP.NET Forms.
Working with ASP.NET Server Controls
Session Variables and Post Back
Introduction to Visual Basic 2008 Programming
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Active Server Pages ASP.Net
Module 1: Getting Started
Chapter 23 – ASP.NET Outline 23.1 Introduction NET Overview
Web Development in Microsoft Visual Studio 2013
Web Development Using ASP .NET
ASP.NET
Module 05: Building ASP .NET Applications
Web Development Using ASP .NET
Chapter 10 Accessing Database Files
ASP.NET Imran Rashid CTO at ManiWeber Technologies.
Presentation transcript:

CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr. Tehseen Riaz Abbasi

Web Technologies and Programming Lecture 28

Introduction to ASP.NET

Retrieving data from MySQL using PHP Connection with database Summary of Previous Lecture Retrieving data from MySQL using PHP Connection with database Execute Select SQL command Make display structure Selecting Command Counting rows Write data CONNECTIONS: login page Deleting record in MySQL using PHP Delete the record Delete Command

Updating records in MySQL using PHP Connection with database Summary of Previous Lecture Updating records in MySQL using PHP Connection with database Update the record Update Command Limit Data Selections

Components of .NET Framework Setting the Environment Today’s Lecture Outline What is ASP.NET ASP.NET Web Forms Model Components of .NET Framework Setting the Environment ASP.NET: An Example Event Handling in ASP.NET Application and Session Events Department of Computer Science, CIIT Islamabad.

Page and Control Events Event Handling using Controls Today’s Lecture Outline… Page and Control Events Event Handling using Controls Common Control Events PostBack and NonPostBack Events Controls with Default Events Department of Computer Science, CIIT Islamabad.

ASP stands for Active Server Pages 1. What Is ASP.NET ASP. ASP stands for Active Server Pages ASP is a program that runs inside IIS IIS stands for Internet Information Service .NET A programming infrastructure created by Microsoft for building, deploying, and running applications and services that use .NETtechnologies, such as desktop applications and Web services.  Department of Computer Science, CIIT Islamabad.

An ASP file is just the same as an HTML file 1. What Is ASP.NET What is an ASP File? An ASP file is just the same as an HTML file An ASP file can contain text, HTML, XML, and scripts Scripts in an ASP file are executed on the server An ASP file has the file extension ".asp" Department of Computer Science, CIIT Islamabad.

1. What Is ASP.NET ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites. It allows you to use a full featured programming language such as C# or VB.NET to build web applications easily. The ASP.NET application codes can be written in any of the following languages: C# Visual Basic.Net Jscript J# Department of Computer Science, CIIT Islamabad.

ASP.NET is a web development platform, which provides 1. What Is ASP.NET ASP.NET is a web development platform, which provides A programming model A comprehensive software infrastructure Various services required to build up robust web applications for PC as well as mobile devices. ASP.NET works on top of the HTTP protocol, and uses the HTTP commands and policies to set a browser-to-server bilateral communication and cooperation. ASP.NET is a part of Microsoft .Net platform. ASP.NET applications are compiled codes, written using the extensible and reusable components or objects present in .Net framework. These codes can use the entire hierarchy of classes in .Net framework. Department of Computer Science, CIIT Islamabad.

1. What Is ASP.NET… ASP.NET application codes can be written in any of the following languages: C# Visual Basic.Net Jscript J# ASP.NET is used to produce interactive, data-driven web applications over the internet. It consists of a large number of controls such as text boxes, buttons, and labels for assembling, configuring, and manipulating code to create HTML pages. Department of Computer Science, CIIT Islamabad.

HTTP is a stateless protocol. 2. ASP.NET Web Forms Model ASP.NET web forms extend the event-driven model of interaction to the web applications. The browser submits a web form to the web server and the server returns a full markup page or HTML page in response. All client side user activities are forwarded to the server for stateful processing. The server processes the output of the client actions and triggers the reactions. HTTP is a stateless protocol. ASP.NET framework helps in storing the information regarding the state of the application, which consists of: Page state Session state Department of Computer Science, CIIT Islamabad.

2. ASP.NET Web Forms Model… The page state is the state of the client, i.e., the content of various input fields in the web form. The session state is the collective information obtained from various pages the user visited and worked with, i.e., the overall session state (Just as we discussed in PHP Lectures). Department of Computer Science, CIIT Islamabad.

Example: Let us take an example of a shopping cart: 2. ASP.NET Web Forms Model… Example: Let us take an example of a shopping cart: User adds items to a shopping cart. Items are selected from a page, say the items page The total collected items and price are shown on a different page, say the cart page. Only HTTP cannot keep track of all the information coming from various pages. ASP.NET session state and server side infrastructure keeps track of the information collected globally over a session. Department of Computer Science, CIIT Islamabad.

2. ASP.NET Web Forms Model… ASP.NET runtime carries the page state to and from the server across page requests while generating ASP.NET runtime codes, and incorporates the state of the server side components in hidden fields. This way, the server becomes aware of the overall application state and operates in a two-tiered connected way. Department of Computer Science, CIIT Islamabad.

Common Language Runtime (CLR) 3. Components of .NET Framework Common Language Runtime (CLR) Performs Memory Management Exception Handling Debugging Security Checking Thread Execution Code Execution Code Safety Verification Compilation. The code that is directly managed by the CLR is called the managed code. When the managed code is compiled, the compiler converts the source code into a CPU independent intermediate language (IL) code. A Just-In-Time (JIT) compiler compiles the IL code into native code, which is CPU specific. Department of Computer Science, CIIT Islamabad.

.NET Framework Class Library 3. Components of .NET Framework… .NET Framework Class Library It contains a huge library of reusable types, classes, interfaces, structures, and enumerated values, which are collectively called types. ASP.NET & ASP.NET AJAX ASP.NET is the web development model and AJAX is an extension of ASP.NET for developing and implementing AJAX functionality. ASP.NET AJAX contains the components that allow the developer to update data on a website without a complete reload of the page. Department of Computer Science, CIIT Islamabad.

3. Components of .NET Framework… ADO.NET It is the technology used for working with data and databases. It provides access to data sources like SQL server, OLE DB, XML etc. The ADO.NET allows connection to data sources for retrieving, manipulating, and updating data. LINQ It imparts data querying capabilities to .Net languages using a syntax which is similar to the tradition query language SQL. Department of Computer Science, CIIT Islamabad.

Visual Studio IDE Can be download from microsoft.com 4. Setting The Environment Visual Studio IDE Can be download from microsoft.com You can get Express Edition because it is free It allows you to write code, compile it, debug it and run it in the browser It has variety of templates for multiple languages which supports .NET framework Department of Computer Science, CIIT Islamabad.

How to Work With ASP.NET: 4. Setting The Environment… How to Work With ASP.NET: Open Visual Studio From the File Menu, Click on New then Click on Website Select ASP.NET Empty Website Name It The Website Will Be Created

4. Setting The Environment… ASP.NET Empty Website Name It

Now Right click on ASPOverView in Solution Explorer Expand Add Section 4. Setting The Environment… Now Right click on ASPOverView in Solution Explorer Expand Add Section Select Add New Item Select Web Form Name It Click Add

4. Setting The Environment… Add New Item Add Section

4. Setting The Environment… Select Web Form Name It Click Add

Now, Let’s Add Some Code in our first ASP.NET Web Site 5. ASP.NET: an Example Now, Let’s Add Some Code in our first ASP.NET Web Site You can see the Web Form As an .aspx file in the Solution Explorer Click on FirstPage.aspx and you can see the HTML code. You can also see that there is a small arrow with FirstPage.aspx in Solution Explorer Expand it, and you will see FirstPage.aspx.cs file That’s the file whre Code Behind is written .aspx file contains HTML and Scripting Code while .aspx.cs contains C# code

5. ASP.NET: an Example… Page Directives

5. ASP.NET: an Example… Button Click Event

5. ASP.NET: an Example… TextBox Button Results

A process communicates through events. 6. Event Handling in ASP.NET An event is an action or occurrence such as a mouse click, a key press, mouse movements, or any system-generated notification. A process communicates through events. For example, interrupts are system-generated events. When events occur, the application should be able to respond to it and manage it. Events in ASP.NET are raised at the client machine and handled at the server machine. For example, a user clicks a button displayed in the browser. A Click event is raised. The browser handles this client-side event by posting it to the server.

6. Event Handling in ASP.NET… The server has a subroutine describing what to do when the event is raised; it is called the event-handler. When the event message is transmitted to the server, it checks whether the Click event has an associated event handler. If it has, the event handler is executed. ASP.NET event handlers generally take two parameters and return void. The first parameter represents the object raising the event and the second parameter is event argument. private void EventName (object sender, EventArgs e);

Application_Start: Application_End: Session_Start: Session_End: 7. Application and Session Events Application_Start: It is raised when the application/website is started Application_End: It is raised when the application/website is stopped. Session_Start: It is raised when a user first requests a page from the application. Session_End: It is raised when the session ends.

DataBinding Disposed Error Init 8. Page and Control Events DataBinding It is raised when a control binds to a data source Disposed It is raised when the page or the control is released Error It is a page event, occurs when an unhandled exception is thrown Init It is raised when the page or the control is initialized

Load PreRender Unload It is raised when a page or control is loaded 8. Page and Control Events… Load It is raised when a page or control is loaded PreRender It is raised when the page or the control is to be rendered Unload It is a raised when a page or control is unloaded from memory

For handling events, there are in-built attributes and event handlers. 9. Event Handling Using Controls All ASP.NET controls are implemented as classes, and they have events which are fired when a user performs a certain action on them. For example, when a user clicks a button the 'Click' event is generated. For handling events, there are in-built attributes and event handlers. Event handler is coded to respond to an event and take appropriate action on it.

The ASP tag for a button control: 9. Event Handling Using Controls… The ASP tag for a button control: <asp:Button ID="btnCancel" runat="server" Text="Cancel" /> The event handler for click event: protected void btnCancel_Click(object sender, EventArgs e) { // Handles Event }

Click Command TextChanged Attribute: OnClick 10. Common Control Events Click Attribute: OnClick Associated Controls: Button, ImageButton, LinkButton, ImageMap Command Attribute: OnCommand Associated Controls: Button, ImageButton, LinkButton TextChanged Attribute: OnTextChanged Associated Controls: TextBox

SelectedIndexChanged 10. Common Control Events… SelectedIndexChanged Attribute: OnSelectedIndexChanged Associated Controls: DropDownList, ListBox, RadioButton, CheckBoxList CheckedChanged Attribute: OnCheckedChanged Associated Controls: RadioButton, CheckBox

11. PostBack Events & Non-PostBack Events Some events cause the form to be posted back to the server immediately, these are called the postback events. For example, the click event such as Button.Click. Some events are not posted back to the server immediately, these are called non-postback events. For example, the change events or selection events such as TextBox.TextChanged or CheckBox.CheckedChanged. The nonpostback events could be made to post back immediately by setting their AutoPostBack property to true.

AdRotator BulletedList Button Calendar CheckBox 12. Controls with Default Events AdRotator Default Event: Ad Created BulletedList Default Event: Click Button Calendar Default Event: SelectionChanged CheckBox Default Event: CheckedChanged

CheckBoxList DataGrid DataList DropDownList HyperLink 12. Controls with Default Events… CheckBoxList Default Event: SelectedIndexChanged DataGrid DataList DropDownList HyperLink Default Event: Click

ImageButton ImageMap LinkButton ListBox Menu Default Event: Click 12. Controls with Default Events… ImageButton Default Event: Click ImageMap LinkButton ListBox Default Event: SelectedIndexChanged Menu Default Event: MenuItemClick

RadioButton RadioButtonList Default Event: CheckedChanged 12. Controls with Default Events… RadioButton Default Event: CheckedChanged RadioButtonList Default Event: SelectedIndexChanged

Components of .NET Framework Setting the Environment Summary of Today’s Lecture What is ASP.NET ASP.NET Web Forms Model Components of .NET Framework Setting the Environment ASP.NET: An Example Event Handling in ASP.NET Application and Session Events Department of Computer Science, CIIT Islamabad.

Page and Control Events Event Handling using Controls Summary of Today’s Lecture… Page and Control Events Event Handling using Controls Common Control Events PostBack and NonPostBack Events Controls with Default Events Good Link: http://www.tutorialspoint.com/asp.net/asp.net_quick_guide.htm Department of Computer Science, CIIT Islamabad.

THANK YOU