SlideShare uma empresa Scribd logo
1 de 41
UNIT 1
Introduction to ASP.Net
By: Hitesh Santani
What is Web?
By: Hitesh Santani
• Web is a large and public network with which we can
access the information from anywhere in the world.
• Generally, people call it The Internet.
• The information which is available on web, is in many
forms like text, images, audio and video.
• This information is embedded into web pages through
which we can access them.
What is a Website?
By: Hitesh Santani
 A website is a collection of web pages.
 These web pages are made up of HTML, CSS, Javascript,
jQuery and a server side programming language like
ASP.Net, PHP, JSP, Java Servlets etc.
 A website can only be used using a web browser.
 Example: www.gmail.co.in
How Internet works?
By: Hitesh Santani
Client
Request
HTTPREQUEST
INTERNE
T
HTTP
Request REQUEST
RESPONSEHTTP
Response
HTTPResponse
Response
Server
Database
How Internet works?
By: Hitesh Santani
• A client is a user who wishes to use the website for the info.
• A server is a machine where the actual website is stored. This
server is connected with the internet.
• The clients use a browser or any other HTTP supported
software to communicate with the server through internet.
• HTTP (Hyper Text Transfer Protocol) is a protocol which
governs the rules related to Hyper Text Transmission in
between two machines on a network.
• Whenever, we type in a URL into the address bar of a
browser, an HTTP Request is generated and is sent to the
server.
• The server then processes this request and replays with an
HTTP Response which contains the HTML output.
What is .Net?
By: Hitesh Santani
 First of all, .Net is not a language but it is a framework.
 It is a software platform with which you can create
windows and web applications.
 It provides you all the required features which can make
your work of developing applications easy.
Architecture of .Net
By: Hitesh Santani
VB C#
Common Language Specification (CLS)
ASP .Net
Web
Services
Web Forms
Windows
Forms
ADO .Net and XML
Base Class Library (BCL) or Framework Class Library (FCL)
Common Language Runtime
Operating System
C++ J# ……Language Compilers
.Net
Framework
Language Compilers
By: Hitesh Santani
 There are compilers available separately for each and
every language individually.
 The task being assigned to the compilers for the .Net
framework, is to convert the source code of the
programs into MSIL Code.
Compilation Process in .Net
By: Hitesh Santani
.vb .cs ……
VB
Compiler
C#
Compiler
……
Common Language Runtime (CLR)
Operating System
Source
Code
Source
Code
Source
Code
Native
Code
MSIL Code
MSIL Code
By: Hitesh Santani
• MSIL Code stands for Microsoft Intermediate Language
Code which is also called IL Code.
• This MSIL Code can not be executed by the hardware.
• MSIL Code solves a major problem i.e. creating a
separate compiler for each of the languages to convert
the source code to a particular device type.
• That’s why it is given to the CLR to generate Native
Code (Machine Code) from it.
• This Native Code can be executed by the hardware.
Common Language Specification (CLS)
By: Hitesh Santani
 Common Language Specification (CLS) is a set of rules.
 These rules must be followed by any language which
wants to be .Net compliant and wants to run it’s
programs in CLR.
 CLS is a subset of Common Type System (CTS).
Common Type System (CTS)
By: Hitesh Santani
• Common Type System (CTS) allows program written in
different programming languages to share information easily.
• This means that we can use a class which is written in C# in
VB.Net.
• Languages must agree on these concepts before they can
integrate with one another.
• CTS defines the rules which must be followed by the
languages to ensure smooth data sharing between them.
• Thus, CTS provides Cross Language Integration or Language
Interoperability.
• CTS supports two categories of types: Value types and
Reference types.
By: Hitesh Santani
 Value types:
 Which stores the data directly in stack.
 In built data types come under this category.
 Reference types:
 Which stores the reference or address instead of storing the
data directly.
 This type of data is stored in heap instead of stack.
 Objects are example of this category.
Framework Class Library (FCL)
By: Hitesh Santani
• Framework Class Library (FCL) which is also known as
Base Class Library (BCL), is a set of readily available
classes.
• It is the in built set of classes which we can directly use
on the fly after importing them into the programs.
• These are like the header files which we used to have in
C or C++.
• This class library consists of thousands of classes which
are categorized into namespaces so that we can
remember them easily.
Namespaces
By: Hitesh Santani
• A namespace is a logical collection/grouping of classes.
• It helps us out to categorize the library classes in according to
their purpose.
• Because of the namespaces, we do not have to remember
names of each and every class.
• We just need to remember the name of the namespace to
which the class belongs.
• A namespace is just a logical container for the library classes.
• Namespaces can be used to differentiate two different classes
with the same name using a Fully Qualified Name. A Fully
Qualified Name is a combination of the class name and the
namespace’s name to which the class belongs.
• The topmost namespace in the .Net framework is System.
The rest of the namespaces are a part of the System
namespace.
Common Language Runtime (CLR)
By: Hitesh Santani
• CLR is one of the main components of .Net.
• It’s the execution engine and environment of the
framework.
• It stays in between the .Net framework and the
underlying Operating System.
• It loads and executes the code.
• It provides all the services which the program may need
at run-time.
• Every language that wants it’s programs to run in CLR,
must obey the rules being imposed by CLR.
Compiled Code
By: Hitesh Santani
 In order to serve the request given by the user, ASP.Net
must first compile the code. We can write the ASP.Net
code in any of the languages supported by .Net
framework.
 When we compile the code, it is translated into MSIL
which is language-independent.
 Then this MSIL is converted into machine-specific
instructions.
Benefits of Compiled Code
By: Hitesh Santani
• Stability: When the code is compiled, it is checked for
syntax error, type safety etc so that many errors can be
eliminated from the later stage.
• Performance: The execution of the compiled code is
faster then the scripts such as VBScript.
• Security: Compiled code is difficult to read. So no one
can convert the compiled code back into the source
code.
• Interoperability: We are able to use assemblies written
in different languages as MSIL supports any .Net
languages.
Inline Code (In-Page Code)
By: Hitesh Santani
 Traditional developers were using this approach.
 Client-side and Server-side code is intermixed into a
single page.
 Becomes very difficult to maintain the events and event
handlers in a large single page.
 Its written in the <script> tag.
Code Behind
By: Hitesh Santani
• Separate files are maintained for Client-side and Server-
side code.
• One file contains HTML which is the .aspx file.
• The other file contains the server-side code which is
called Code Behind file. It can be either .vb or .cs.
• Separates the design layout and the coding part.
• At the time of compilation, both files are combined and
one class is generated which is used to serve the user
requests.
Object Oriented Concepts
By: Hitesh Santani
 Class
 Fields
 Properties
 Methods
 Events
 Objects
 Constructors
 Destructors
 Encapsulation
 Inheritance
 Abstraction
 Abstract Class
 Interface
 Polymorphism
 Method Overriding
 Partial Classes
Class
By: Hitesh Santani
 The class is a template through which we can create an
object.
 In .Net, it contains fields, properties, methods
(procedures and functions) and events.
 Syntax:
[Access Modifier] [Shadows] [MustInherit|NotInheritable] Class <name>
[Implements <interfacename>]
Statements
End Class
Fields
By: Hitesh Santani
 They are the variables in the class.
 They can be read or set directly.
 They store the actual data which is being given to an
object.
 Example:
Public Class MyClass
Public x As Integer
End Class
Properties
By: Hitesh Santani
• Properties are retrieved and set like fields.
• They are implemented using Property Get and Property Set
procedures which provide more control on how values are set or
returned.
• Example:
Public Class MyClass
Private Name As String
Public Property FullName() As String
Get
Return Name
End Get
Set(ByVal Value As String)
Name = Value
End Set
End Property
End Class
Methods
By: Hitesh Santani
• Methods represent the object’s built-in procedures.
• For example, a class named Employee may have methods
named CalculateSalary and CalculateLeaves.
• We can defined methods by adding procedures and functions
to the class.
• Example:
Public Class Employee
Public Sub CalculateSalary()
Write(“-------”)
End Sub
Public Sub CalculateLeaves()
Write(“-------”)
End Sub
End Class
Objects
By: Hitesh Santani
 They are the basic runtime entities. They are the
variables of the class.
 It is said to be the instance of the class.
 Example:
Dim obj as MyClass
Constructor
By: Hitesh Santani
 They are the special procedures that are invoked
automatically when an object of a class is created.
 Example:
Public Sub New(ByVal newValue as Integer)
value = newValue
End Sub
Destructor
By: Hitesh Santani
• We know how to create constructor, but what about destructor?
• It is also executed automatically when an object is about to be
destroyed.
• We can place code to clean up the reserved resources in a
destructor.
• In VB.Net, we can use the Finalize method for this purpose. The
Finalize method is called automatically when an object is marked as
unusable and is to be destroyed.
• Example:
Public Class MyClass
Protected Overrides Sub Finalize()
Statements
End Sub
End Class
Encapsulation
By: Hitesh Santani
• The process of combining data members and methods in
a single unit is called Encapsulation.
• When using Data Encapsulation, data is not accessed
directly, it is only accessible through the functions
available within the class.
• Data Encapsulation enables the important concept of
Data Hiding.
• Protecting data from unauthorized access is called Data
Hiding.
Inheritance
By: Hitesh Santani
• It is the process by which object of one class acquires the
properties (members) of another class.
• It’s the process of forming a new class from an existing
class.
• The existing class is called a parent/super/base class.
• The new class is called child/sub/derived class.
• It is important because it supports hierarchical
classification and code reusability.
• We can add new features to a class without even
touching it by deriving a new class.
• To inherit the class, Inherits keyword is used with the
derived class.
By: Hitesh Santani
 Example:
Public Class Person
‘Members of Person class
End Class
Public Class Employee Inherits Person
‘Members of Employee class
End Class
Abstraction
By: Hitesh Santani
 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.
 When the classes use the concept of data abstraction,
they are also known as Abstract Data Types (ADT).
Abstract Class
By: Hitesh Santani
 MustInherit keyword is used to declare a class that
cannot be instantiated and can be used only as a base
class.
 It is also called an Abstract Base Class (ABC).
Interface
By: Hitesh Santani
• Example:
Public Interface person
Sub SetName(ByVal PersonName As String)
Function GetName() As String
End Interface
Public Class employee Implements person
Dim Name As String
Sub SetName(ByVal PersonName As String) Implements person.SetName
Name = PersonName
End Sub
Function GetName() As String Implements person.GetName
Return Name
End Function
End Class
Polymorphism
By: Hitesh Santani
 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 types is called polymorphism.
 To use one function name for many different purposes is
known as function overloading.
 Overloads keyword is used.
By: Hitesh Santani
• Example:
Overloads Function Add(ByVal a1 As Integer, ByVal a2 As
Integer) As Integer
Return a1+a2
End Function
Overloads Function Add(ByVal a1 As Integer, ByVal a2 As
Integer, ByVal a3 As Integer) As Integer
Return a1+a2+a3
End Function
Method Overriding
By: Hitesh Santani
 The process in which a subclass provide a specific
implementation of a method, that is already provided by
one of its super classes is called Method Overriding.
 The implementation in the subclass overrides (replaces)
the implementation in the superclass.
By: Hitesh Santani
• Following keywords are for method overriding:
– Overridable: Allows a property or method in a class to be
overridden.
– Overrides: Overrides an Overridable property or method.
– NotOverridable: Prevents a property or method from being
overridden. Public methods are NotOverridable by default.
– MustOverride: Requires that a derived class override the
property or method. MustOverride methods must be declared
in MustInherit classes.
Event Driven Programming
By: Hitesh Santani
Event Driven Programming
By: Hitesh Santani
• Event: An event is a user action which he/she has
performed for a purpose. Examples are clicking or double
clicking a button, typing a character, hovering mouse
pointer etc.
• Event Source: An event source is an element on the
screen on which the user performs the action which
triggers the event.
• Event Handler: An event handler is a set of statements
which has been written to handle a specific event.
• Event Dispatcher: This is the module which handles all
the triggered events and calls the appropriate event
handler function.
Any Questions in this unit?
By: Hitesh Santani

Mais conteúdo relacionado

Mais procurados (20)

CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp Presentation
 
.NET and C# Introduction
.NET and C# Introduction.NET and C# Introduction
.NET and C# Introduction
 
Introduction to c#
Introduction to c#Introduction to c#
Introduction to c#
 
Introduction to c#
Introduction to c#Introduction to c#
Introduction to c#
 
Core java complete ppt(note)
Core java  complete  ppt(note)Core java  complete  ppt(note)
Core java complete ppt(note)
 
Introduction To Dotnet
Introduction To DotnetIntroduction To Dotnet
Introduction To Dotnet
 
Basics of JAVA programming
Basics of JAVA programmingBasics of JAVA programming
Basics of JAVA programming
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
Java programming course for beginners
Java programming course for beginnersJava programming course for beginners
Java programming course for beginners
 
.Net framework
.Net framework.Net framework
.Net framework
 
DOT Net overview
DOT Net overviewDOT Net overview
DOT Net overview
 
Collections and its types in C# (with examples)
Collections and its types in C# (with examples)Collections and its types in C# (with examples)
Collections and its types in C# (with examples)
 
C#.NET
C#.NETC#.NET
C#.NET
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Java servlet life cycle - methods ppt
Java servlet life cycle - methods pptJava servlet life cycle - methods ppt
Java servlet life cycle - methods ppt
 
Front End Development | Introduction
Front End Development | IntroductionFront End Development | Introduction
Front End Development | Introduction
 
PHP Project PPT
PHP Project PPTPHP Project PPT
PHP Project PPT
 
J2EE Introduction
J2EE IntroductionJ2EE Introduction
J2EE Introduction
 
Introduction to VB.net
Introduction to VB.netIntroduction to VB.net
Introduction to VB.net
 
Class and Objects in Java
Class and Objects in JavaClass and Objects in Java
Class and Objects in Java
 

Destaque

Data compression introduction
Data compression introductionData compression introduction
Data compression introductionRahul Khanwani
 
.NET Framework Overview
.NET Framework Overview.NET Framework Overview
.NET Framework OverviewDoncho Minkov
 
Tabel Dosis N3W Ultimate Power Pada Bensin Pertalite
Tabel Dosis N3W Ultimate Power Pada Bensin PertaliteTabel Dosis N3W Ultimate Power Pada Bensin Pertalite
Tabel Dosis N3W Ultimate Power Pada Bensin PertaliteRidwan Soleh Nata
 
Python 入門初體驗(程式語法)
Python 入門初體驗(程式語法)Python 入門初體驗(程式語法)
Python 入門初體驗(程式語法)政斌 楊
 
по лесным тропинкам 2
по лесным тропинкам 2по лесным тропинкам 2
по лесным тропинкам 2yakushenkova
 
อภัยกูเถิด
อภัยกูเถิดอภัยกูเถิด
อภัยกูเถิดI'Pai Parichat
 

Destaque (13)

Data compression
Data compressionData compression
Data compression
 
Jsp Introduction Tutorial
Jsp Introduction TutorialJsp Introduction Tutorial
Jsp Introduction Tutorial
 
Data compression introduction
Data compression introductionData compression introduction
Data compression introduction
 
Data compression
Data compression Data compression
Data compression
 
.NET Framework Overview
.NET Framework Overview.NET Framework Overview
.NET Framework Overview
 
Compression techniques
Compression techniquesCompression techniques
Compression techniques
 
Tabel Dosis N3W Ultimate Power Pada Bensin Pertalite
Tabel Dosis N3W Ultimate Power Pada Bensin PertaliteTabel Dosis N3W Ultimate Power Pada Bensin Pertalite
Tabel Dosis N3W Ultimate Power Pada Bensin Pertalite
 
Mysore
MysoreMysore
Mysore
 
Python 入門初體驗(程式語法)
Python 入門初體驗(程式語法)Python 入門初體驗(程式語法)
Python 入門初體驗(程式語法)
 
по лесным тропинкам 2
по лесным тропинкам 2по лесным тропинкам 2
по лесным тропинкам 2
 
Biodata
BiodataBiodata
Biodata
 
อภัยกูเถิด
อภัยกูเถิดอภัยกูเถิด
อภัยกูเถิด
 
Organ donation
Organ donationOrgan donation
Organ donation
 

Semelhante a Introduction to .Net (20)

Dot net
Dot netDot net
Dot net
 
.Net framework
.Net framework.Net framework
.Net framework
 
Session2 (3)
Session2 (3)Session2 (3)
Session2 (3)
 
Dotnet1
Dotnet1Dotnet1
Dotnet1
 
Dotnet interview qa
Dotnet interview qaDotnet interview qa
Dotnet interview qa
 
ASP.NET Session 2
ASP.NET Session 2ASP.NET Session 2
ASP.NET Session 2
 
Common language runtime clr
Common language runtime clrCommon language runtime clr
Common language runtime clr
 
.Net framework
.Net framework.Net framework
.Net framework
 
.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligeti.Net framework components by naveen kumar veligeti
.Net framework components by naveen kumar veligeti
 
.Net overview|Introduction Of .net
.Net overview|Introduction Of .net.Net overview|Introduction Of .net
.Net overview|Introduction Of .net
 
Part i
Part iPart i
Part i
 
.net Based Component Technologies
.net Based Component Technologies.net Based Component Technologies
.net Based Component Technologies
 
NETOverview1ppt.pptx
NETOverview1ppt.pptxNETOverview1ppt.pptx
NETOverview1ppt.pptx
 
NETOverview1.ppt
NETOverview1.pptNETOverview1.ppt
NETOverview1.ppt
 
.Net overview
.Net overview.Net overview
.Net overview
 
VB IMPORTANT QUESTION
VB IMPORTANT QUESTIONVB IMPORTANT QUESTION
VB IMPORTANT QUESTION
 
C# and dot net framework
C# and dot net frameworkC# and dot net framework
C# and dot net framework
 
Web Technology Fundamentals
Web Technology FundamentalsWeb Technology Fundamentals
Web Technology Fundamentals
 
dot NET Framework
dot NET Frameworkdot NET Framework
dot NET Framework
 
.Net overviewrajnish
.Net overviewrajnish.Net overviewrajnish
.Net overviewrajnish
 

Último

%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 

Último (20)

%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 

Introduction to .Net

  • 1. UNIT 1 Introduction to ASP.Net By: Hitesh Santani
  • 2. What is Web? By: Hitesh Santani • Web is a large and public network with which we can access the information from anywhere in the world. • Generally, people call it The Internet. • The information which is available on web, is in many forms like text, images, audio and video. • This information is embedded into web pages through which we can access them.
  • 3. What is a Website? By: Hitesh Santani  A website is a collection of web pages.  These web pages are made up of HTML, CSS, Javascript, jQuery and a server side programming language like ASP.Net, PHP, JSP, Java Servlets etc.  A website can only be used using a web browser.  Example: www.gmail.co.in
  • 4. How Internet works? By: Hitesh Santani Client Request HTTPREQUEST INTERNE T HTTP Request REQUEST RESPONSEHTTP Response HTTPResponse Response Server Database
  • 5. How Internet works? By: Hitesh Santani • A client is a user who wishes to use the website for the info. • A server is a machine where the actual website is stored. This server is connected with the internet. • The clients use a browser or any other HTTP supported software to communicate with the server through internet. • HTTP (Hyper Text Transfer Protocol) is a protocol which governs the rules related to Hyper Text Transmission in between two machines on a network. • Whenever, we type in a URL into the address bar of a browser, an HTTP Request is generated and is sent to the server. • The server then processes this request and replays with an HTTP Response which contains the HTML output.
  • 6. What is .Net? By: Hitesh Santani  First of all, .Net is not a language but it is a framework.  It is a software platform with which you can create windows and web applications.  It provides you all the required features which can make your work of developing applications easy.
  • 7. Architecture of .Net By: Hitesh Santani VB C# Common Language Specification (CLS) ASP .Net Web Services Web Forms Windows Forms ADO .Net and XML Base Class Library (BCL) or Framework Class Library (FCL) Common Language Runtime Operating System C++ J# ……Language Compilers .Net Framework
  • 8. Language Compilers By: Hitesh Santani  There are compilers available separately for each and every language individually.  The task being assigned to the compilers for the .Net framework, is to convert the source code of the programs into MSIL Code.
  • 9. Compilation Process in .Net By: Hitesh Santani .vb .cs …… VB Compiler C# Compiler …… Common Language Runtime (CLR) Operating System Source Code Source Code Source Code Native Code MSIL Code
  • 10. MSIL Code By: Hitesh Santani • MSIL Code stands for Microsoft Intermediate Language Code which is also called IL Code. • This MSIL Code can not be executed by the hardware. • MSIL Code solves a major problem i.e. creating a separate compiler for each of the languages to convert the source code to a particular device type. • That’s why it is given to the CLR to generate Native Code (Machine Code) from it. • This Native Code can be executed by the hardware.
  • 11. Common Language Specification (CLS) By: Hitesh Santani  Common Language Specification (CLS) is a set of rules.  These rules must be followed by any language which wants to be .Net compliant and wants to run it’s programs in CLR.  CLS is a subset of Common Type System (CTS).
  • 12. Common Type System (CTS) By: Hitesh Santani • Common Type System (CTS) allows program written in different programming languages to share information easily. • This means that we can use a class which is written in C# in VB.Net. • Languages must agree on these concepts before they can integrate with one another. • CTS defines the rules which must be followed by the languages to ensure smooth data sharing between them. • Thus, CTS provides Cross Language Integration or Language Interoperability. • CTS supports two categories of types: Value types and Reference types.
  • 13. By: Hitesh Santani  Value types:  Which stores the data directly in stack.  In built data types come under this category.  Reference types:  Which stores the reference or address instead of storing the data directly.  This type of data is stored in heap instead of stack.  Objects are example of this category.
  • 14. Framework Class Library (FCL) By: Hitesh Santani • Framework Class Library (FCL) which is also known as Base Class Library (BCL), is a set of readily available classes. • It is the in built set of classes which we can directly use on the fly after importing them into the programs. • These are like the header files which we used to have in C or C++. • This class library consists of thousands of classes which are categorized into namespaces so that we can remember them easily.
  • 15. Namespaces By: Hitesh Santani • A namespace is a logical collection/grouping of classes. • It helps us out to categorize the library classes in according to their purpose. • Because of the namespaces, we do not have to remember names of each and every class. • We just need to remember the name of the namespace to which the class belongs. • A namespace is just a logical container for the library classes. • Namespaces can be used to differentiate two different classes with the same name using a Fully Qualified Name. A Fully Qualified Name is a combination of the class name and the namespace’s name to which the class belongs. • The topmost namespace in the .Net framework is System. The rest of the namespaces are a part of the System namespace.
  • 16. Common Language Runtime (CLR) By: Hitesh Santani • CLR is one of the main components of .Net. • It’s the execution engine and environment of the framework. • It stays in between the .Net framework and the underlying Operating System. • It loads and executes the code. • It provides all the services which the program may need at run-time. • Every language that wants it’s programs to run in CLR, must obey the rules being imposed by CLR.
  • 17. Compiled Code By: Hitesh Santani  In order to serve the request given by the user, ASP.Net must first compile the code. We can write the ASP.Net code in any of the languages supported by .Net framework.  When we compile the code, it is translated into MSIL which is language-independent.  Then this MSIL is converted into machine-specific instructions.
  • 18. Benefits of Compiled Code By: Hitesh Santani • Stability: When the code is compiled, it is checked for syntax error, type safety etc so that many errors can be eliminated from the later stage. • Performance: The execution of the compiled code is faster then the scripts such as VBScript. • Security: Compiled code is difficult to read. So no one can convert the compiled code back into the source code. • Interoperability: We are able to use assemblies written in different languages as MSIL supports any .Net languages.
  • 19. Inline Code (In-Page Code) By: Hitesh Santani  Traditional developers were using this approach.  Client-side and Server-side code is intermixed into a single page.  Becomes very difficult to maintain the events and event handlers in a large single page.  Its written in the <script> tag.
  • 20. Code Behind By: Hitesh Santani • Separate files are maintained for Client-side and Server- side code. • One file contains HTML which is the .aspx file. • The other file contains the server-side code which is called Code Behind file. It can be either .vb or .cs. • Separates the design layout and the coding part. • At the time of compilation, both files are combined and one class is generated which is used to serve the user requests.
  • 21. Object Oriented Concepts By: Hitesh Santani  Class  Fields  Properties  Methods  Events  Objects  Constructors  Destructors  Encapsulation  Inheritance  Abstraction  Abstract Class  Interface  Polymorphism  Method Overriding  Partial Classes
  • 22. Class By: Hitesh Santani  The class is a template through which we can create an object.  In .Net, it contains fields, properties, methods (procedures and functions) and events.  Syntax: [Access Modifier] [Shadows] [MustInherit|NotInheritable] Class <name> [Implements <interfacename>] Statements End Class
  • 23. Fields By: Hitesh Santani  They are the variables in the class.  They can be read or set directly.  They store the actual data which is being given to an object.  Example: Public Class MyClass Public x As Integer End Class
  • 24. Properties By: Hitesh Santani • Properties are retrieved and set like fields. • They are implemented using Property Get and Property Set procedures which provide more control on how values are set or returned. • Example: Public Class MyClass Private Name As String Public Property FullName() As String Get Return Name End Get Set(ByVal Value As String) Name = Value End Set End Property End Class
  • 25. Methods By: Hitesh Santani • Methods represent the object’s built-in procedures. • For example, a class named Employee may have methods named CalculateSalary and CalculateLeaves. • We can defined methods by adding procedures and functions to the class. • Example: Public Class Employee Public Sub CalculateSalary() Write(“-------”) End Sub Public Sub CalculateLeaves() Write(“-------”) End Sub End Class
  • 26. Objects By: Hitesh Santani  They are the basic runtime entities. They are the variables of the class.  It is said to be the instance of the class.  Example: Dim obj as MyClass
  • 27. Constructor By: Hitesh Santani  They are the special procedures that are invoked automatically when an object of a class is created.  Example: Public Sub New(ByVal newValue as Integer) value = newValue End Sub
  • 28. Destructor By: Hitesh Santani • We know how to create constructor, but what about destructor? • It is also executed automatically when an object is about to be destroyed. • We can place code to clean up the reserved resources in a destructor. • In VB.Net, we can use the Finalize method for this purpose. The Finalize method is called automatically when an object is marked as unusable and is to be destroyed. • Example: Public Class MyClass Protected Overrides Sub Finalize() Statements End Sub End Class
  • 29. Encapsulation By: Hitesh Santani • The process of combining data members and methods in a single unit is called Encapsulation. • When using Data Encapsulation, data is not accessed directly, it is only accessible through the functions available within the class. • Data Encapsulation enables the important concept of Data Hiding. • Protecting data from unauthorized access is called Data Hiding.
  • 30. Inheritance By: Hitesh Santani • It is the process by which object of one class acquires the properties (members) of another class. • It’s the process of forming a new class from an existing class. • The existing class is called a parent/super/base class. • The new class is called child/sub/derived class. • It is important because it supports hierarchical classification and code reusability. • We can add new features to a class without even touching it by deriving a new class. • To inherit the class, Inherits keyword is used with the derived class.
  • 31. By: Hitesh Santani  Example: Public Class Person ‘Members of Person class End Class Public Class Employee Inherits Person ‘Members of Employee class End Class
  • 32. Abstraction By: Hitesh Santani  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.  When the classes use the concept of data abstraction, they are also known as Abstract Data Types (ADT).
  • 33. Abstract Class By: Hitesh Santani  MustInherit keyword is used to declare a class that cannot be instantiated and can be used only as a base class.  It is also called an Abstract Base Class (ABC).
  • 34. Interface By: Hitesh Santani • Example: Public Interface person Sub SetName(ByVal PersonName As String) Function GetName() As String End Interface Public Class employee Implements person Dim Name As String Sub SetName(ByVal PersonName As String) Implements person.SetName Name = PersonName End Sub Function GetName() As String Implements person.GetName Return Name End Function End Class
  • 35. Polymorphism By: Hitesh Santani  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 types is called polymorphism.  To use one function name for many different purposes is known as function overloading.  Overloads keyword is used.
  • 36. By: Hitesh Santani • Example: Overloads Function Add(ByVal a1 As Integer, ByVal a2 As Integer) As Integer Return a1+a2 End Function Overloads Function Add(ByVal a1 As Integer, ByVal a2 As Integer, ByVal a3 As Integer) As Integer Return a1+a2+a3 End Function
  • 37. Method Overriding By: Hitesh Santani  The process in which a subclass provide a specific implementation of a method, that is already provided by one of its super classes is called Method Overriding.  The implementation in the subclass overrides (replaces) the implementation in the superclass.
  • 38. By: Hitesh Santani • Following keywords are for method overriding: – Overridable: Allows a property or method in a class to be overridden. – Overrides: Overrides an Overridable property or method. – NotOverridable: Prevents a property or method from being overridden. Public methods are NotOverridable by default. – MustOverride: Requires that a derived class override the property or method. MustOverride methods must be declared in MustInherit classes.
  • 40. Event Driven Programming By: Hitesh Santani • Event: An event is a user action which he/she has performed for a purpose. Examples are clicking or double clicking a button, typing a character, hovering mouse pointer etc. • Event Source: An event source is an element on the screen on which the user performs the action which triggers the event. • Event Handler: An event handler is a set of statements which has been written to handle a specific event. • Event Dispatcher: This is the module which handles all the triggered events and calls the appropriate event handler function.
  • 41. Any Questions in this unit? By: Hitesh Santani