ASP.NET OVERVIEW

adhocjackpotSecurity

Nov 5, 2013 (3 years and 11 months ago)

108 views

Web Programming

Building ASP.NET Applications

T.
Ahlam

Algharasi

4
th

Level

The Visual Studio IDE


Start page


2

Websites in Visual Studio


Create
a new ASP.NET application.

3

Websites in Visual Studio


The New Web Site window

4

Websites in Visual Studio


The New Web Site window allows you to specify three
details
:



Template: The template determines what files your website
starts with. Visual Studio
supports two
types of basic
ASP.NET

applications
: web site applications and web service
applications
.



Location: The location specifies where the website files will be
stored.



Language: The language identifies the .NET programming
language you’ll use to code your website.

5

The Visual Studio IDE

6

2

1

3

4

The Visual Studio IDE

7

Description

Windows

Lists the files and subfolders that are in the
web application folder.

Solution
Explorer

Shows ASP.NET’s built
-
in server controls
and any third
-

party controls or custom
controls that you build yourself and add to
the Toolbox. Controls can be written in any
language and used in any language.

Toolbox

Allows you to configure the currently
selected element, whether it’s a file in the
Solution Explorer or a control on the design
surface of a web form.

Properties

Reports on errors that Visual Studio has
detected in your code but that you haven’t
resolved yet.

Error List

Solution Explorer


It allows you to see the files that are in the web application
directory.


ASP.NET
File Types


8

Description

File

These are ASP.NET web pages .They
contain the user interface and, optionally,
the underlying application code.

Ends with
.
aspx

These are ASP.NET user controls. User
controls are similar to web pages, except
that they can’t be accessed directly. User
controls allow you to develop an
important piece of the user interface and
reuse it in as many web forms as you want
without repetitive code.

Ends with
.
ascx

Solution Explorer


ASP.NET File
Types


9

Description

File

This is the XML
-
based configuration file for
your ASP.NET application. It includes
settings for customizing security, memory
management, and much more.

web.config

These are ASP.NET web services. Web
services work differently than web pages,
but they still share the same application
resources, configuration settings, and
memory
.

Ends with
.
asmx

These are code
-
behind files that contain
vb

code. They allow you to separate the
application from the user interface of a web
page.

Ends with .
vb

Solution Explorer



App_Data

Folder


This directory is reserved for data storage, including
database
files
,
XML
files, and other data store files.
Of course, you’re
free to store
data files
in other directories.

10

Toolbox Tabs

11

Description

Tab

This tab includes the rich web server controls
that are the heart of ASP.NET’s web form
model.

Standard

These components allow you to connect to a
database.

Data

These controls allow you to verify an
associated input control against user
-
defined
rules. For example, you can specify the input
can’t be empty, it must be a number, it must be
g牥a瑥t⁴ an a 捥牴ain va汵攬ean搠獯n.

Validation

These controls are designed to display site
maps and allow the user to navigate from one
page to another.

Navigation

These controls provide prebuilt security
solutions, such as login boxes and a wizard

for creating users.

Login

Toolbox Tabs


You can customize both the tabs and the items in each tab.


To modify the tab groups, right
-
click a tab heading, and select
Rename Tab, Add Tab, or Delete Tab.


To add an item, right
-
click the blank space on the Toolbox, and
Select Items. You can also drag items from one tab group to
another.


12

Description

Tab

This tab allows you to drag and drop static
HTML elements.

HTML

Provides a repository for code snippets and
control objects. Just drag and drop them here,
and pull them off when you need to use them
later.

General

Code Debugging


To test this page, select Debug

Start Debugging from the menu.
Because this is the first
time running
any page in this application,
Visual Studio will inform you that you need a
configuration file
that
specifically enables
debugging









Click
OK to add this configuration file
.



13

ASP.net Server

The Coding Model


Visual Studio supports two models for coding web pages and web
services
:



Code
-
behind


This model separates each ASP.NET web page into two files:
an .
aspx

markup file with the HTML and control tags, and a
.
vb

code file with the source code for the page.


This model provides better organization


important when building complex pages.




14

The Coding Model


Code
-
behind Example


“Default.aspx” Page


15

The Coding Model


Code
-
behind Example



Default.aspx.vb
” Page


16

The Coding Model


Inline code


This model is the closest to traditional ASP. All the code and
HTML is stored in a single .
aspx

file. The code is embedded in
one or more script blocks.


it’s popular for coding simple web pages.


17

The Coding Model


Inline code Example


18

Choosing the coding model


When you add a new web page to your website (
using Website

Add New Item), the Place Code in a Separate File check box
chooses whether you want
to use
the code
-
behind
model or not.

19

Web
Forms


The
term used to describe an ASP.NET web page is web
form
.


The
basic structure of a web form is shown here:

20

C
ONTROLS

Server Controls


Server controls


are a fundamental part of the ASP.NET architecture
.


are tags that are understood by the server.



There are three kinds of server controls:


HTML Server Controls
-

Traditional HTML tags


Web Server Controls
-

New ASP.NET tags


Validation Controls
-

For input validation


22

Server Controls


HTML Server
Controls



HTML server controls are standard
HTML tags and
they are declared with
the
runat
="server" attribute.


The
runat
="server" attribute indicates
that the form should be processed on the
server.

23

Server Controls


Web Server
Controls


These classes duplicate the functionalities of the basic
HTML tags but have a
more consistent
and meaningful set
of properties and methods that make it easier for
the
developer to
declare and access them.

24

Server Controls


Validation
Controls


are used to validate user
-
input. For Example If the user
-
input
does not pass validation, it will display an error message to
the user.

25

Questions