0% found this document useful (0 votes)
23 views7 pages

Awp 2

Master pages in ASP.NET are used to create consistency across pages in a website. They define common page elements like headers, footers, and navigation that are shared among content pages. Content pages display information within the framework defined by the associated master page. Master pages help provide a consistent look and user experience across an entire application or site.

Uploaded by

Omkar Gilbile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views7 pages

Awp 2

Master pages in ASP.NET are used to create consistency across pages in a website. They define common page elements like headers, footers, and navigation that are shared among content pages. Content pages display information within the framework defined by the associated master page. Master pages help provide a consistent look and user experience across an entire application or site.

Uploaded by

Omkar Gilbile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Master pages

are used to create consistency from page to page in a document.

Extension of master page: .master

To some extent, a master page looks like a normal ASPX page.

features of master pages


▪ Mater page provides a framework within which the content from other pages can
be displayed.
▪ Provides elements such as header, footer, style definition or navigation bar
▪ It gives a consistent look and feel for all pages in your application.

Roles of master page


Master page consists of 2 pieces:

▪ Master page itself


▪ One or more content pages

A single master page defines the look and feel and standard behavior.

Important selectors present in CSS


Universal selector

▪ Indicated by asterisk (*)


▪ applies to all elements in your page
▪ *{ color: red;}
Type selector:

▪ all HTML elements of that type will be styled accordingly.


▪ h1 {color: red;}
Id selector:

▪ applies changes to elements whose id is text


▪ #Text{ color: red; }
Class selector:

▪ applies changes to elements whose class is text


▪ .text{ color: red; }

View state:
client-side state management mechanism

store the page value at the time of post back of your page.

Advantage of ViewState:

▪ easy to implement
▪ no server resources are required
▪ Enhanced security features

Disadvantage of ViewState:

▪ It does not have any support on mobile devices.

Three Different Ways to Use Styles on Web Pages:

Inline style:
It is directly placed inside an HTML tag.

<p style=”color:red;”>

Internal style sheet:


It is used to add a unique style for a single document.

It is defined in <head> section of the HTML page inside the <style>

External style sheet:


it’s placed in a completely separate file.

it allows you a way to apply the same style rules to many pages
Cookies
A small piece of data stored on a client browser

When a user requests for a web page, web server sends not just a page, but also a cookie
containing the date and time.

This cookie stores in a folder on the user's hard disk.

When the user requests for the web page again, browser looks on the hard drive for the
cookie associated with the web page.

There are 2 types of cookies:

▪ Persist Cookie - stay on the user’s browser for a very long time.
▪ Non-Persist Cookie – This cookie expires after a certain time

Common properties of cookies:

▪ Domain, Secure, Value, Values and Expires.

Advantage of cookie:

▪ Readable, Easy to Maintain and Fast Accessing

Disadvantages of Cookie

▪ No security.
▪ Each request will have cookie information with page.

THEME

▪ A theme decides the look and feel of the website


▪ Theme is collection of files that define the looks of a page.
▪ can include skin files, CSS files & images
▪ Skin files define the common property setting like button, textbox, label
▪ Extension of skin file is .skin
▪ Themes allow us to improve the usability of our site
DEBUGGING

Debugging allows the developers to see how the code works in a step-by-step manner.

Breakpoints: a point in the program where the code will stop executing.

To set a breakpoint right click on the code and choose insert break point

Exception handling:

a process to handle runtime errors. ling:

It maintains the normal flow of the application

Four keywords to perform exception handling:

▪ try
▪ catch
▪ finally
▪ throw
Difference between list box and drop-down list

DROP-DOWN LIST LIST BOX


Only one item of drop-down list is visible More than one item of drop-down list is
when it renders on the page visible when it renders on the page

Only one item can be selected More than one item can be selected

WEB FORMS:
▪ main purpose of Web Forms is to overcome the limitations of ASP
▪ compatible to any browser
▪ It is flexible and allows us to create and add custom controls.
▪ provides various controls like: server controls and HTML controls for the Web
Forms.
▪ WEB FORM IS MADE UP OF: ASPX file and the code behind the form

Calendar control

• Displaying one month at a time


• Selecting a day, a week or a month
• Selecting a range of days
• Moving from month to month
• Controlling the display of the days programmatically

PAGE CLASS:
When asp.net page is requested and renders markup to a browser, it creates an instance
if a class that represents our page.

PAGE PROPERTIES:

• IsPostBack
• EnableViewState
• Application
• Session
• Request
• Response

User-defined Exceptions are defined by the user/programmer.

used to make the meaningful exception

ADO.NET

.NET Framework

provides a bridge between the front-end controls and the back-end


database.

ADO.NET includes many objects we can use to work with data.

Objects of ADO.NET are:

▪ Connection: To interact with a database, we must have a connection


to it.
▪ Command: It Uses the connection object to execute SQL queries.
▪ DataReader: allows us to obtain the results of a SELECT statement
from a command object.
▪ DataSet
▪ DataAdapter

Architecture of ADO.NET:

▪ asConnection
▪ Command
▪ DataSet objects

Features of ADO.NET:

▪ Interoperability
▪ Maintainability
▪ Programmability
▪ Performance
▪ Scalability

DataReader:

▪ allows us to obtain the results of a SELECT statement from a


command object.
▪ Easy way for programmers to read data from database
▪ It is the solution for forward streaming data through ADO.NET
▪ Also known as firehose cursor or forward read-only cursor

GRID VIEW:

The GridView control displays the values of a data source in a table.

Each column represents a field, while each row represents a record.

GridView helps to perform key activities like Insert, Delete, Sorting, and
Paging.

It supports the following features:

▪ Built-in sort capabilities.


▪ Multiple key fields.
▪ Built-in update and delete capabilities.

You might also like