Unit1_Introduction_ASP_2022
Unit1_Introduction_ASP_2022
Unit 1
Introduction to ASP .NET
- What is ASP .NET
- .Net framework 2.0
- Compile code
• Code Behind and Inline Coding
- The Common Language Runtime
- Object Oriented Concepts
- Event Driven Programming
6) XML support
Visual Studio .NET supports for writing, manipulating and transforming XML
documents.
Other functions,
I. Memory Management
II. Verification of type safety
III. Access to metadata
IV. Code access Security
V. Exception Handling
VI. Garbage collection
I. Value types
Stores directly data on stack.
In build data type.
Example: dim a as Integer
II. Reference types
Stores a reference to the value’s memory address, and are allocated on
the heap.
Example: dim obj as new Oledbconnection
It is a subset of CTS.
It defines a set of rules and restrictions that every language must follow which
runs under the. NET framework.
CLS includes basic language features needed by almost all the application.
It serves as a guide for library writers and compiler writers.
5. .NET Assemblies
It is a small unit of code that contains a logical compiled code in the Common
Language infrastructure (CLI), which is used for deployment, security and
versioning.
It defines in two parts (process) DLL and library (exe) assemblies.
When the .NET program is compiled, it generates a metadata with Microsoft
Intermediate Language, which is stored in a file called Assembly.
7. Window Services
Locate classes
Load classes
Generate native code
Provide security
Namespace Description
System Contains fundamental classes and base classes
System.IO Contains classes for reading and writing data in file
System.XML Contains classes to work with XML
System.Windows.Forms Contains classes for windows-based applications
System.Data Contains classes for the database connection
The .NET Framework provides class libraries that can be used by your
application.
Some of the key classes help you with input/output, access to operating
system services, data access, or even debugging. We will go into more detail
on some of them in this module.
4. Graphical Development Environment
Visual Studio .NET provides a very rich development environment for Web
developers. You can drag and drop controls and set properties.
5. State management
To refer to the problems mentioned before, ASP.NET provides solutions for
session and application state management.
State information can, for example, be kept in memory or stored in a
database.
6. Update files while the server is running
Components of your application can be updated while the server is online and
clients are connected.
7. XML-Based Configuration Files
Configuration settings in ASP.NET are stored in XML files that you can easily
read and edit.
You can also easily copy these to another server, along with the other files
that comprise your application.
8. Security
With built in Windows authentication and per-application configuration, you
can be assured that your applications are secure.
5 Built-in Maximum four in-built classes i.e. On other hand ASP.NET has
Class. Request, Response, Session and more than 2000 in-built
Application are present in ASP. classes.
In pages where there is not very much code, the convenience of keeping
the code and markup in the same file.
Pages written using the single-file model are slightly easier to deploy or to
another programmer because there is only one file.
Single-file page is easier to rename.
Number of file in the project is less.
2) 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 .cs or. vb code file with the
source code for the page.
2) Page_Init()
It is executed after the Prelnit() event. It is used to retrieve or initialize
control properties.
3) Page Preload()
Prior to this event, the ViewState data and PostBack data are restored to
the controls. This event is used if we want to do some task before load
event is executed.
4) Page Load()
It calls the Load event of the page as well as each control on the page.
This event is use to set the properties of the controls and it can also be
used to establish database connection.
5) Control events
They are useful to handle the events of the controls. E.g. click event of the
Button.
6) Page_PreRender()
7) Page_Unload()
It is executed for each control and then for the page. So we can say that it
is useful for the final cleanup such as closing the connection, closing files,
completing log etc.
1.6.1. Object
They are the basic runtime entities having attributes (data type) and
behaviors (functions).
(functions). They are the variables of the class. It is said to be the
instance of the class.
It is a real time entity.
1.6.2. Class
The class is a template through which we can create an object.
Class is a data structure that contains data members (constants files, events),
member function methods, properties, constructor, destructor, indexers and
nested type.
It is a collection objects.
Basically,
1) It is a user defined data type.
2) It is a referenc
reference type.
3) Infect class is a tag or template for object.
1.6.3. Encapsulation
The process of uniting data members and methods in a single unit is called
Encapsulation. In other words, to combine data and function into a single
logical unit is known as encapsulation.
When using Data Encapsulation, data is not accessed directly;
directly it is only
accessible through the functions present inside the class. Data Encapsulation
enables the important concept of data hiding.
1.6.4. Inheritance
It is the process by which object of one class acquire the properties, i.e. data /
attributes of object, of another class. That means inheritance is the process
of forming a new class from an existing class or base class.
The base class is also known as parent class or super class, the new class
created from base class is called derived class. Derived class is also known
as a child class or sub class. Inheritance helps in reducing the overall code
size of the program, which is an important concept in object-oriented
programming.
This is important because it supports hierarchical classification. In object
oriented programming the concepts of inheritance provide the idea of
reusability. This means that we can add additional features to an existing
class without modifying it.
This is possible by deriving a new class from the existing one. The new class
has the combine features of both the classes.
To inherit the class Inherits keyword is used with derived class.
1.6.5. Abstraction
It is a mechanism of representing essential features without including
background details.
Data Abstraction increases the power of programming language by creating
user defined data types. Data Abstraction also represents the needed
information in the program without presenting the details.
When the classes use the concept of data abstraction, they are also known
as Abstract DataTypes (ADT).
1.6.6. Polymorphism
It is the Greek word, poly means many and morphism means forms i.e. one
name many forms.
The ability of functions and operators to act in different ways on different data
type is called polymorphism.
To use one function name for many different purposes is known as function
overloading. So Overloading is one type of Polymorphism. It allows an
object to have different meanings, depending on its context.
Polymorphism allows routines to use variables of different types whenever
required. To implement function overloading, Overloads keyword is used.
There are two ways to implement polymorphism
1) Static Polymorphism (compile time)
2) Dynamic Polymorphism (run time)