Module 5
Module 5
Department of MCA
Programming using C# .Net -18MCA51
Module 5: Web App Development and Data
Access using ADO.NET
Handling By
Nirupama K
Asst. Prof. Dept. of MCA
BMS INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Basics of Web
• In its simplest form, a web page is nothing more than an HTML (HyperText Markup Language)
document (with the extension .html or .htm) that describes to a web browser the docu-ment’s
content and how to format it
• URIs and URLs
• URIs (Uniform Resource Identifiers) identify resources on the Internet. URIs that start with
• http:// are called URLs (Uniform Resource Locators).
04/04/2024 2
BMS INSTITUTE OF TECHNOLOGY AND MANAGEMENT
04/04/2024 3
BMS INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Multitier Application Architecture
Information Tier
• The information tier (also called the bottom tier) maintains the application’s data. This tier
typically stores data in a relational database management system.
• For example, a retail store might have a database for storing product information, such as
descriptions, prices and quantities in stock. The same database also might contain customer
information, such as user names, billing addresses and credit card numbers
• This tier can contain multiple databases, which together comprise the data needed for an
application.
Business Logic
• The middle tier implements business logic, controller logic and presentation logic to control
interactions between the application’s clients and its data
04/04/2024 4
BMS INSTITUTE OF TECHNOLOGY AND MANAGEMENT
• The middle tier acts as an intermediary between data in the information tier and the application’s
clients. The middle-tier controller logic processes client requests (such as requests to view a
product catalog) and retrieves data from the database.
• The middle-tier presentation logic then processes data from the information tier and presents the
content to the client. Web applications typically present data to clients as web pages.
• Business logic in the middle tier enforces business rules and ensures that data is reliable
• before the server application updates the database or presents the data to users
• Business rules dictate how clients can and cannot access application data, and how applications
process data. For example, a business rule in the middle tier of a retail store’s web-based appli-
cation might ensure that all product quantities remain positive.
• A client request to set a negative quantity in the bottom tier’s product information database
would be rejected by the middle tier’s business logic
04/04/2024 5
BMS INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Client Tier
• The client tier, or top tier, is the application’s user interface, which gathers input and dis-plays
output. Users interact directly with the application through the user interface (typically viewed in
a web browser), keyboard and mouse.
• In response to user actions (for example, clicking a hyperlink), the client tier interacts with the
middle tier to make re-quests and to retrieve data from the information tier. The client tier then
displays to the user the data retrieved from the middle tier. The client tier never directly interacts
with the information tier
04/04/2024 6
BMS INSTITUTE OF TECHNOLOGY AND MANAGEMENT
04/04/2024 7
BMS INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Introducing new features of ASP .NET 4.0
• ASP .NET core services
• ASP .NET web Forms
• Dynamic Data
• ASP .NET Chart control
• Microsoft AJAX functionality
• Improved CSS capability
ASP .NET core services
• Refactoring of the web config file
• Output caching
• Auto start web application
• Redirecting a page
• Compressing session state
• Range of allowable URLs
04/04/2024 8
BMS INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Dynamic data
• Including a Rapid Application Development, It help to data driven web application
• Automatic validation
• Dynamic Control control
• Dynamic Data Manager control
• Dynamic Entity control
• Dynamic Filter control
• Dynamic HyperLink control
• Dynamic validator control
04/04/2024 9
BMS INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Creating a sample website
04/04/2024 10
BMS INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Validation Controls
• RequiredFieldValidator
• RangeValidator
• CompareValidator
• RegularExpressionValidator
• CustomValidator
• ValidationSummary
Required Field Validator Control
The Required Field Validator control ensures that the required field is not empty. It is generally tied
to a text box to force input into the text box.
<asp: Required Field Validator ID="rfvcandidate"
runat="server" ControlToValidate ="ddlcandidate"
ErrorMessage="Please choose a candidate"
InitialValue="Please choose a candidate">
</asp : Required Field Validator>
04/04/2024 11
BMS INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Range Validator Control
The Range Validator control verifies that the input value falls within a predetermined range.
Properties Description
Type It defines the type of the data. The available values are: Currency, Date,
Double, Integer, and String.
04/04/2024 13
BMS INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Custom Validator
The Custom Validator control allows writing application specific custom validation routines for both
the client side and the server side validation.
The client side validation is accomplished through the Client Validation Function property. The
client side validation routine should be written in a scripting language, such as JavaScript or
VBScript, which the browser can understand.
The server side validation routine must be called from the control's Server Validate event handler.
The server side validation routine should be written in any .NET language, like C# or VB. Net.
Validation Summary
The Validation Summary control does not perform any validation but shows a summary of all errors
in the page. The summary displays the values of the Error Message property of all validation
controls that failed validation.
The following two mutually inclusive properties list out the error message:
Show Summary : shows the error messages in specified format.
Show Message Box : shows the error messages in a separate window.
04/04/2024 14
BMS INSTITUTE OF TECHNOLOGY AND MANAGEMENT
Validation Groups
Complex pages have different groups of information provided in different panels. In such situation,
a need might arise for performing validation separately for separate group. This kind of situation is
handled using validation groups.
To create a validation group, you should put the input controls and the validation controls into the
same logical group by setting their Validation Group property.
Example
The following example describes a form to be filled up by all the students of a school, divided into
four houses, for electing the school president. Here, we use the validation controls to validate the
user input.
04/04/2024 15