Download ASP.NET TUTORIAL FOR PROGRAMMERS and more Essays (university) Computer Science in PDF only on Docsity!
i
About the Tutorial
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.
This tutorial covers all the basic elements of ASP.NET that a beginner would require to get started.
Audience
This tutorial is prepared for the beginners to help them understand basic ASP.NET programming. After completing this tutorial, you will find yourself at a moderate level of expertise in ASP.NET programming from where you can take yourself to next levels.
Prerequisites
Before proceeding with this tutorial, you should have a basic understanding of .NET programming language. As we are going to develop web-based applications using ASP.NET web application framework, it will be good if you have an understanding of other web technologies such as HTML, CSS, AJAX, etc.
Disclaimer & Copyright
Copyright 2014 by Tutorials Point (I) Pvt. Ltd.
All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher. We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or in this tutorial, please notify us at [email protected].
iii
- EVENT HANDLING..............................................................................................................
- Event Arguments
- Application and Session Events
- Page and Control Events........................................................................................................................
- Event Handling Using Controls
- Default Events
- SERVER SIDE
- Server Object
- Request Object
- Response Object
- SERVER CONTROLS
- Properties of the Server Controls
- Methods of the Server Controls
- HTML SERVER
- Advantages of using HTML Server Controls
- CLIENT SIDE
- Client Side Scripts
- Client Side Source Code
- BASIC CONTROLS
- Button Controls
- Text Boxes and Labels
- Check Boxes and Radio Buttons
- List Controls
- The ListItemCollection Object
- Radio Button list and Check Box List
- Bulleted lists and Numbered Lists
- HyperLink Control iv
- Image Control
- DIRECTIVES
- The Application Directive
- The Assembly Directive
- The Control Directive
- The Implements Directive
- The Import Directive
- The Master Directive
- The MasterType Directive
- The OutputCache Directive
- The Page Directive
- The PreviousPageType Directive
- The Reference Directive
- The Register Directive
- MANAGING STATE
- View State
- Control State
- Session State
- Application State
- VALIDATORS
- BaseValidator Class
- RequiredFieldValidator Control
- RangeValidator Control
- CompareValidator Control
- RegularExpressionValidator
- CustomValidator
- ValidationSummary............................................................................................................................... v
- Validation Groups
- DATABASE ACCESS.............................................................................................................
- Retrieving and Displaying Data
- ADO.NET..........................................................................................................................
- The DataSet Class
- The DataTable Class
- The DataRow Class
- The DataAdapter Object......................................................................................................................
- The DataReader Object
- DbCommand and DbConnection Objects
- FILE UPLOADING..............................................................................................................
- AD ROTATORS
- The Advertisement File
- Properties and Events of the AdRotator Class
- Working with AdRotator Control.........................................................................................................
- CALENDARS
- Properties and Events of the Calendar Control
- Working with the Calendar Control
- MULTI VIEWS...................................................................................................................
- Properties of View and MultiView Controls
- PANEL CONTROLS............................................................................................................
- Working with the Panel Control
- AJAX CONTROLS
- The ScriptManager Control
- The UpdatePanel Control
- The UpdateProgress Control vi
- The Timer Control
- DATA SOURCES................................................................................................................
- Data Source Views
- The SqlDataSource Control..................................................................................................................
- The ObjectDataSource Control
- The AccessDataSource Control
- DATA BINDING.................................................................................................................
- Simple Data Binding
- Declarative Data Binding
- CUSTOM CONTROLS
- User Controls
- Custom Controls
- Working with Custom Controls
- PERSONALIZATION
- Understanding Profiles
- Attributes for the Element
- Anonymous Personalization
- ERROR HANDLING
- DEBUGGING
- Breakpoints
- The Debug Windows
- LINQ
- SECURITY vii
- Forms-Based Authentication
- IIS Authentication: SSL
- DATA CACHING................................................................................................................
- What is Caching?
- Caching in ASP.NET
- Output Caching
- Data Caching
- Object Caching
- WEB SERVICES
- Creating a Web Service
- Consuming the Web Service
- Creating the Proxy...............................................................................................................................
- MULTITHREADING
- Creating Thread...................................................................................................................................
- Thread Life Cycle
- Thread Priority
- Thread : Properties and Methods
- CONFIGURATION
- Configuration Section Handler declarations
- Application Settings
- Connection Strings
- System.Web Element
- DEPLOYMENT
- XCOPY Deployment
- Copying a Website
What is ASP.NET?
ASP.NET is a web development platform, which provides a programming model, a comprehensive software infrastructure and 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.
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.
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.
Now, 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
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. To clear the concept, let us take an example of a shopping cart:
1. INTRODUCTION
User adds items to a shopping cart. Items are selected from a page, say the items page, and 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.
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.
The ASP.NET Component Model
The ASP.NET component model provides various building blocks of ASP.NET pages. Basically it is an object model, which describes:
Server side counterparts of almost all HTML elements or tags such as