SlideShare una empresa de Scribd logo
1 de 54
Descargar para leer sin conexión
Introduction to ASP.NET
Week 11, day1
ASP
Active Server Pages
‚ASP.NET is a server side scripting language‛
.NET overview
•.NET is a framework for developing web-based and
windows-based applications within the Microsoft
environment.
• Components of .NET
 MICROSOFT Intermediate language - all code is
complied into a more abstract, trimmed version before
execution. All .NET languages are compiled to MSIL –
the common language of .NET
The CLR- common language runtime; responsible for
executing MSIL code; interfaces to Windows and IIS
A rich set of libraries (Framework Class Libraries)
available to all .NET languages
Components of .NET (Continuation)
The .NET languages such as C#, VB.NET etc that
conform to CLR
ASP.NET is how the Framework is exposed to the
web, using IIS (internet information system) to manage
simple pages of code so that they can be complied into
full .NET programs. These generate HTML for the
browser (when the page is requested by a client
browser).
Generate HTML
Get index.aspx
1
3
4
pass index.aspx to .net
framework
5
WebServer
Index.aspx in
interpreted HTMl form
Browser
2
Get index.aspx from
hard disk
How IIS takes requests and processes it
.NET
Scripting Languages
• A ‚script‛ is a collection of program or sequence of instructions that is
interpreted or carried out by another program rather than by the computer
processor. Two types of scripting languages are
– Client-side Scripting Language
– Server-side Scripting Language
• In server-side scripting, (such as PHP, ASP) the script is processed by the
server Like: Apache, ColdFusion, ISAPI and Microsoft's IIS on Windows.
• Client-side scripting such as JavaScript runs on the web browser.
Generate HTML
Get index.aspx
1
3
4
pass index.aspx to .net
framework
5
WebServer
Index.aspx in
interpreted HTMl form
Browser
2
Get index.aspx from
hard disk
How IIS takes requests and processes it
.NET
ASP.NET is a server side
scripting language because the
code runs on the server and
returns the result in html form
to the client browser
Generate HTML
Get index.aspx
1
3
4
pass index.aspx to .net
framework
5
WebServer
Index.aspx in
interpreted HTMl form
Browser
2
Get index.aspx from
hard disk
How IIS takes requests and processes it
.NET
Client side scripting is something
where code runs on client
side(browser). For eg checking
whether a HTML text field contains
data or not can be done by running
a script from browser itself
Microsoft Visual Studio
•Microsoft Visual Studio is an IDE (Integrated Development
Environment) on which .net applications can be created
easily.
•It is a powerful tool that can expose the features of the
.net framework to make the developers work easier
•Applications can be run from within the IDE and has
inbuilt compiler and debugger (no need to install third
party servers like WAMP, XAMPP etc. to run the application
as in case of PHP)
•It exposes a rich design based interface to manage any
aspect of a .net project from design to deployment
Creating an asp.net page
Create a new asp.net website project
Go to start > all programs > microsoft visual studio 2008 (or whatever version
you have installed)
Create a new asp.net website project
Click on file > new web site
Create a new asp.net website project
(for C# select the language as Visual C#)
Create a new asp.net website project
Create a new asp.net website project
Create a new asp.net website project
Create a new asp.net website project
Create a new asp.net website project
• Double click on the button control you just created
Create a new asp.net website project
• You can also add handlers for other events of the button
Adding connection string to the web.config file
Adding a new item to the project
Adding a new item to the project
Running the project
Getting started with ASP.NET programming
.Net Controls, Events and Event handlers
• .net Controls –
 There are no. of controls those are available in the toolbox inside visual
studio. Eg. Button, textbox, dropdownlist etc.
 Each control represents a class extended from
the System.Web.UI.WebControls class
 Each control has events, properties and methods associated with it
 Each control in an aspx page is identified by a unique id, no two controls
on the same page can share an id
• Events
 Events happen when the user does some sort of action on a control eg.
Click for a button, changing the text for a textbox etc.
• Event Handlers
 Event handlers are code blocks that will be executed when events are
raised
.Net Controls, Events and Event handlers (continuation)
 In plain words an event handler for the click of a button that has an id
“btn_a” will tell the server like
“Do this on the click of btn_a”
 There are no. of event handlers associated with each type of .net control
 Custom event handlers can also be registered for certain controls.
Commenting
// comment single line
/* comment
multiple lines */
C#
//comment single line
/* Comment
multiple Lines*/
VB.NET
‘comment single line
/* Comment
multiple Lines*/
C ASP.NET
Data Types
Data types
• ASP.NET supports many different data types such as
o Integer
o String
o Double
o Boolean
o Datetime
o Arrays
Type Casting
 Response.write ((0.1 + 0.7) * 10); //Outputs 8
 Response.write ([cint] ((0.1 + 0.7) * 10));//Outputs 7
• This happens because the result of this simple arithmetic
expression is stored internally as 7.999999 instead of 8; when the
value is converted to integer, ASP.NET simply truncates away the
fractional part, resulting in a rather significant error (12.5%, to be
exact).
Variables
Declaring a variable
//Declaring a variable
Int a=10;
Char c=‘a’;
Float f=1.12;
C#
String a; //variable without initialisation
String a = ‚Hello‛; //variable with
initialisation
VB.NET
Dim a as string //variable without
initialisation
dim a as string = ‚Hello‛ //variable with
initialisation
C ASP.NET
Variables
• Variables are temporary storage containers.
• In ASP.NET, a variable can contain any type of data, such as, for example,
strings, integers, floating numbers, objects and arrays provided the variable
must be declared in that datatype.
• As in case of PHP which is loosely typed, ASP.NET will not implicitly
change the type of a variable as needed. ASP.NET languages are strongly
typed, like C and Java, where variables can only contain one type of data
throughout their existence.
Constants
Declaring a constant
//Declaring a constant using ‘const’
const int a=10;
int const a=10;
//Declaring a constant using ‘#define’
#define TRUE 1
#define FALSE 0
#define NAME_SIZE 20
C#
Const String a = ‚Hello‛;
VB.NET
const a as string = ‚Hello‛
C ASP.NET
Constants
• Conversely to variables, constants are meant for defining immutable
values.
• Compile-time and Run-time Constants
A compile-time constant is computed at the time the code is compiled,
while a run-time constant can only be computed while the application is
running. A compile-time constant will have the same value each time an
application runs, while a run-time constant may change each time.
Control structures
Control Structures
Conditional Control Structures
• If
• If else
• Switch
Loops
For
While
Do while
Other
• Break
• Continue
‚Exactly the same as on left side‛
+
• return
• go to
C ASP.NET
functions
Functions
Int findSum(int a,int b)
{
Int c;
c=a+b;
Return c
}
findSum(10,15);
function findSum(byVal a as
integer,byVal b as integer)
Dim c as integer
c=a+b
Return c
End function
Dim d as integer = findSum(10,15)
Response.write(d) ‘output : 25
C ASP.NET (vb.net example)
Functions
public int findSum(int a, int b) {
int c;
c = (a + b);
return c;
}
private int d = findSum(10, 15);
Response.write(d); //output : 25
ASP.NET (C# example)
Function arguments
• You can define any number of arguments to an ASP.NET function.
• Arguments can be passed by reference(byRef) or by value (byValue)
o byRef - When an argument is passed by reference, the called
procedure can change the value of the variable. The change persists
after the procedure is called
o byValue - When an argument is passed by value, any changes that the
called procedure makes to the value of the variable do not persist
after the procedure is called.
Function return type
• The function return type can also be defined in the function
declaration
– VB.net
Function findSum(byval a as integer, byval b as integer) as integer
Dim c as integer
c=a+b
Return c
End function
– C#
public int findSum(int a, int b) {
int c;
c = (a + b);
return c;
}
Function return type
• A function without a return value is called as a sub routine
and is defined as follows in ASP.NET
– Vb.net
private sub findSum(byval a as integer, byval b as integer)
Dim c as integer
c=a+b
End sub
– C#
Protected void findSum(int a, int b)
{
int c;
c=a+b;
}
Strings
Char a*+=‚Baabtra‛;
Printf(‚Hello %s‛,a);
Dim a as string =‚Baabtra‛
Response.write( ‚Hello ‛ + a) //Output:
Hello baabtra
Response.write( ‚Hello + a‛) //Output:
Hello + a
‚Strings will be continued in coming
chapters‛
C ASP.NET
Arrays
Indexed Array
int a[]={1,2,3,4,5,6,7,8,9,10};
for(i=0;i<10;i++)
Printf(‚%d‛,a[i]);
‚Array will be continued in coming
chapters‛
Declaring an array of strings
Vb.net
Dim arrStr as string() //without
initialisation
Dim arrStr as string() = (‚a‛, ‚b‛)
//with initialisation
C#
string[] arrStr ;//without
initialisation
string[] arrStr = new string[] {
"one", "two", "three" } //with
initialisation
C ASP.NET
Operators
Operators
C
Arithmetic Operators
+, ++, -, --, *, /, %
Comparison Operators
==, !=, ===, !==, >, >=, < , <=
Logical Operators
&&, ||, !
Assignment Operators
=, +=, -=, *=, /=, %=
ASP.NET
Arithmetic Operators
Ope
rato
r
description Example Re
sul
t
+ Addition myNum = 3 + 4 7
- Subtraction myNum = 4 - 3 1
* Multiplication myNum = 3 * 4 12
/ Division myNum = 12 /4 3
^ Exponential myNum = 2 ^ 4 16
Mod Modulus myNum = 23
Mod 10
3
- Negation myNum = -10 -10
 Integer
Division
myNum = 9  3 3
Comparison operators
Operator description Example Result
= Equal to 3 = 4 false
< Less than 4 < 3 false
> Greater than 4 > 3 true
<= Less than or equal to 4 <= 4 true
>= Greater than or equal to 4 >= 5 false
<> / != Not equal to 4 <> 3 / 4 != 3 true
Logical operators
Operator description Example Result
And / && Both Must be TRUE True And False false
Or / || One Must be TRUE True Or False true
Not / ! Flips Truth Value Not true false
String operators
Operator description Example Result
& / +
String Concatenation string4 = “Hello" & " world"
string4 = “Hello
world"
• Bitwise operators allow you to manipulate bits of data. All these operators are
designed to work only on integer numbers—therefore, the interpreter will attempt
to convert their operands to integers before executing them.
Bitwise Operators
AND Bitwise AND. The result of the operation will be a value whose bits are set if they are set
in both operands, and unset otherwise.
OR Bitwise OR. The result of the operation will be a value whose bits are set if they are set in
either operand (or both), and unset otherwise.
XOR Bitwise XOR (exclusive OR). The result of the operation will be a value whose bits are set
if they are set in either operand, and unset otherwise.
NOT Bitwise NOT. inverts each bit in a sequence of bits. A 0 becomes a 1, and a 1 becomes
a 0.
<< Bitwise left shift. This operation shifts the left-hand operand’s bits to the left by a number
of positions equal to the right operand, inserting unset bits in the shifted positions
>> Bitwise right shift. This operation shifts the left-hand operand’s bits to the right by a
number of positions equal to the right operand, inserting unset bits in the shifted
positions.
End of day 1
If this presentation helped you, please visit our
page facebook.com/baabtra and like it.
Thanks in advance.
www.baabtra.com | www.massbaab.com |www.baabte.com
Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Angularjs PPT
Angularjs PPTAngularjs PPT
Angularjs PPT
 
ASP.NET Lecture 1
ASP.NET Lecture 1ASP.NET Lecture 1
ASP.NET Lecture 1
 
Introduction to c#
Introduction to c#Introduction to c#
Introduction to c#
 
Design patterns ppt
Design patterns pptDesign patterns ppt
Design patterns ppt
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp Presentation
 
Mvc architecture
Mvc architectureMvc architecture
Mvc architecture
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
C# programming language
C# programming languageC# programming language
C# programming language
 
Scripting languages
Scripting languagesScripting languages
Scripting languages
 
JSON: The Basics
JSON: The BasicsJSON: The Basics
JSON: The Basics
 
Introduction To C#
Introduction To C#Introduction To C#
Introduction To C#
 
Asp Architecture
Asp ArchitectureAsp Architecture
Asp Architecture
 
ASP.NET Web form
ASP.NET Web formASP.NET Web form
ASP.NET Web form
 
C# Tutorial
C# Tutorial C# Tutorial
C# Tutorial
 
Asp.NET Validation controls
Asp.NET Validation controlsAsp.NET Validation controls
Asp.NET Validation controls
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
C# 101: Intro to Programming with C#
C# 101: Intro to Programming with C#C# 101: Intro to Programming with C#
C# 101: Intro to Programming with C#
 
Visual programming lecture
Visual programming lecture Visual programming lecture
Visual programming lecture
 

Destacado

Dev Basics: The ASP.NET Page Life Cycle
Dev Basics: The ASP.NET Page Life CycleDev Basics: The ASP.NET Page Life Cycle
Dev Basics: The ASP.NET Page Life CycleJay Harris
 
DotNet Introduction
DotNet IntroductionDotNet Introduction
DotNet IntroductionWei Sun
 
Dotnet Basics Presentation
Dotnet Basics PresentationDotnet Basics Presentation
Dotnet Basics PresentationSudhakar Sharma
 
.NET Framework Overview
.NET Framework Overview.NET Framework Overview
.NET Framework OverviewDoncho Minkov
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net frameworkArun Prasad
 
ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1Kumar S
 

Destacado (7)

Sdk overview
Sdk overviewSdk overview
Sdk overview
 
Dev Basics: The ASP.NET Page Life Cycle
Dev Basics: The ASP.NET Page Life CycleDev Basics: The ASP.NET Page Life Cycle
Dev Basics: The ASP.NET Page Life Cycle
 
DotNet Introduction
DotNet IntroductionDotNet Introduction
DotNet Introduction
 
Dotnet Basics Presentation
Dotnet Basics PresentationDotnet Basics Presentation
Dotnet Basics Presentation
 
.NET Framework Overview
.NET Framework Overview.NET Framework Overview
.NET Framework Overview
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net framework
 
ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1ASP.NET Tutorial - Presentation 1
ASP.NET Tutorial - Presentation 1
 

Similar a ASP.NET Basics

Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web ApplicationRishi Kothari
 
How to develop asp web applications
How to develop asp web applicationsHow to develop asp web applications
How to develop asp web applicationsDeepankar Pathak
 
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.pptintroaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.pptAvijitChaudhuri3
 
introaspnet.ppt
introaspnet.pptintroaspnet.ppt
introaspnet.pptasmachehbi
 
Visual Studio.NET
Visual Studio.NETVisual Studio.NET
Visual Studio.NETsalonityagi
 
introasp_net-7364068.ppt
introasp_net-7364068.pptintroasp_net-7364068.ppt
introasp_net-7364068.pptIQM123
 
introasp_net-6563550.ppt
introasp_net-6563550.pptintroasp_net-6563550.ppt
introasp_net-6563550.pptIQM123
 
introaspnet-3030384.ppt
introaspnet-3030384.pptintroaspnet-3030384.ppt
introaspnet-3030384.pptIQM123
 
introaspnet-5856912.ppt
introaspnet-5856912.pptintroaspnet-5856912.ppt
introaspnet-5856912.pptIQM123
 
Unit - 1: ASP.NET Basic
Unit - 1:  ASP.NET BasicUnit - 1:  ASP.NET Basic
Unit - 1: ASP.NET BasicKALIDHASANR
 

Similar a ASP.NET Basics (20)

ASP DOT NET
ASP DOT NETASP DOT NET
ASP DOT NET
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
 
How to develop asp web applications
How to develop asp web applicationsHow to develop asp web applications
How to develop asp web applications
 
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.pptintroaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
 
introaspnet.ppt
introaspnet.pptintroaspnet.ppt
introaspnet.ppt
 
introaspnet.ppt
introaspnet.pptintroaspnet.ppt
introaspnet.ppt
 
Visual Studio.NET
Visual Studio.NETVisual Studio.NET
Visual Studio.NET
 
introasp_net-7364068.ppt
introasp_net-7364068.pptintroasp_net-7364068.ppt
introasp_net-7364068.ppt
 
introasp_net-6563550.ppt
introasp_net-6563550.pptintroasp_net-6563550.ppt
introasp_net-6563550.ppt
 
Introduction to asp
Introduction to aspIntroduction to asp
Introduction to asp
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Visual studio.net
Visual studio.netVisual studio.net
Visual studio.net
 
introaspnet-3030384.ppt
introaspnet-3030384.pptintroaspnet-3030384.ppt
introaspnet-3030384.ppt
 
introaspnet-5856912.ppt
introaspnet-5856912.pptintroaspnet-5856912.ppt
introaspnet-5856912.ppt
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Unit - 1: ASP.NET Basic
Unit - 1:  ASP.NET BasicUnit - 1:  ASP.NET Basic
Unit - 1: ASP.NET Basic
 
Introaspnet
IntroaspnetIntroaspnet
Introaspnet
 

Más de baabtra.com - No. 1 supplier of quality freshers

Más de baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 

Último

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Último (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

ASP.NET Basics

  • 2. ASP Active Server Pages ‚ASP.NET is a server side scripting language‛
  • 3. .NET overview •.NET is a framework for developing web-based and windows-based applications within the Microsoft environment. • Components of .NET  MICROSOFT Intermediate language - all code is complied into a more abstract, trimmed version before execution. All .NET languages are compiled to MSIL – the common language of .NET The CLR- common language runtime; responsible for executing MSIL code; interfaces to Windows and IIS A rich set of libraries (Framework Class Libraries) available to all .NET languages
  • 4. Components of .NET (Continuation) The .NET languages such as C#, VB.NET etc that conform to CLR ASP.NET is how the Framework is exposed to the web, using IIS (internet information system) to manage simple pages of code so that they can be complied into full .NET programs. These generate HTML for the browser (when the page is requested by a client browser).
  • 5. Generate HTML Get index.aspx 1 3 4 pass index.aspx to .net framework 5 WebServer Index.aspx in interpreted HTMl form Browser 2 Get index.aspx from hard disk How IIS takes requests and processes it .NET
  • 6. Scripting Languages • A ‚script‛ is a collection of program or sequence of instructions that is interpreted or carried out by another program rather than by the computer processor. Two types of scripting languages are – Client-side Scripting Language – Server-side Scripting Language • In server-side scripting, (such as PHP, ASP) the script is processed by the server Like: Apache, ColdFusion, ISAPI and Microsoft's IIS on Windows. • Client-side scripting such as JavaScript runs on the web browser.
  • 7. Generate HTML Get index.aspx 1 3 4 pass index.aspx to .net framework 5 WebServer Index.aspx in interpreted HTMl form Browser 2 Get index.aspx from hard disk How IIS takes requests and processes it .NET ASP.NET is a server side scripting language because the code runs on the server and returns the result in html form to the client browser
  • 8. Generate HTML Get index.aspx 1 3 4 pass index.aspx to .net framework 5 WebServer Index.aspx in interpreted HTMl form Browser 2 Get index.aspx from hard disk How IIS takes requests and processes it .NET Client side scripting is something where code runs on client side(browser). For eg checking whether a HTML text field contains data or not can be done by running a script from browser itself
  • 9. Microsoft Visual Studio •Microsoft Visual Studio is an IDE (Integrated Development Environment) on which .net applications can be created easily. •It is a powerful tool that can expose the features of the .net framework to make the developers work easier •Applications can be run from within the IDE and has inbuilt compiler and debugger (no need to install third party servers like WAMP, XAMPP etc. to run the application as in case of PHP) •It exposes a rich design based interface to manage any aspect of a .net project from design to deployment
  • 11. Create a new asp.net website project Go to start > all programs > microsoft visual studio 2008 (or whatever version you have installed)
  • 12. Create a new asp.net website project Click on file > new web site
  • 13. Create a new asp.net website project (for C# select the language as Visual C#)
  • 14. Create a new asp.net website project
  • 15. Create a new asp.net website project
  • 16. Create a new asp.net website project
  • 17. Create a new asp.net website project
  • 18. Create a new asp.net website project • Double click on the button control you just created
  • 19. Create a new asp.net website project • You can also add handlers for other events of the button
  • 20. Adding connection string to the web.config file
  • 21. Adding a new item to the project
  • 22. Adding a new item to the project
  • 24. Getting started with ASP.NET programming
  • 25. .Net Controls, Events and Event handlers • .net Controls –  There are no. of controls those are available in the toolbox inside visual studio. Eg. Button, textbox, dropdownlist etc.  Each control represents a class extended from the System.Web.UI.WebControls class  Each control has events, properties and methods associated with it  Each control in an aspx page is identified by a unique id, no two controls on the same page can share an id • Events  Events happen when the user does some sort of action on a control eg. Click for a button, changing the text for a textbox etc. • Event Handlers  Event handlers are code blocks that will be executed when events are raised
  • 26. .Net Controls, Events and Event handlers (continuation)  In plain words an event handler for the click of a button that has an id “btn_a” will tell the server like “Do this on the click of btn_a”  There are no. of event handlers associated with each type of .net control  Custom event handlers can also be registered for certain controls.
  • 27. Commenting // comment single line /* comment multiple lines */ C# //comment single line /* Comment multiple Lines*/ VB.NET ‘comment single line /* Comment multiple Lines*/ C ASP.NET
  • 29. Data types • ASP.NET supports many different data types such as o Integer o String o Double o Boolean o Datetime o Arrays
  • 30. Type Casting  Response.write ((0.1 + 0.7) * 10); //Outputs 8  Response.write ([cint] ((0.1 + 0.7) * 10));//Outputs 7 • This happens because the result of this simple arithmetic expression is stored internally as 7.999999 instead of 8; when the value is converted to integer, ASP.NET simply truncates away the fractional part, resulting in a rather significant error (12.5%, to be exact).
  • 32. Declaring a variable //Declaring a variable Int a=10; Char c=‘a’; Float f=1.12; C# String a; //variable without initialisation String a = ‚Hello‛; //variable with initialisation VB.NET Dim a as string //variable without initialisation dim a as string = ‚Hello‛ //variable with initialisation C ASP.NET
  • 33. Variables • Variables are temporary storage containers. • In ASP.NET, a variable can contain any type of data, such as, for example, strings, integers, floating numbers, objects and arrays provided the variable must be declared in that datatype. • As in case of PHP which is loosely typed, ASP.NET will not implicitly change the type of a variable as needed. ASP.NET languages are strongly typed, like C and Java, where variables can only contain one type of data throughout their existence.
  • 35. Declaring a constant //Declaring a constant using ‘const’ const int a=10; int const a=10; //Declaring a constant using ‘#define’ #define TRUE 1 #define FALSE 0 #define NAME_SIZE 20 C# Const String a = ‚Hello‛; VB.NET const a as string = ‚Hello‛ C ASP.NET
  • 36. Constants • Conversely to variables, constants are meant for defining immutable values. • Compile-time and Run-time Constants A compile-time constant is computed at the time the code is compiled, while a run-time constant can only be computed while the application is running. A compile-time constant will have the same value each time an application runs, while a run-time constant may change each time.
  • 38. Control Structures Conditional Control Structures • If • If else • Switch Loops For While Do while Other • Break • Continue ‚Exactly the same as on left side‛ + • return • go to C ASP.NET
  • 40. Functions Int findSum(int a,int b) { Int c; c=a+b; Return c } findSum(10,15); function findSum(byVal a as integer,byVal b as integer) Dim c as integer c=a+b Return c End function Dim d as integer = findSum(10,15) Response.write(d) ‘output : 25 C ASP.NET (vb.net example)
  • 41. Functions public int findSum(int a, int b) { int c; c = (a + b); return c; } private int d = findSum(10, 15); Response.write(d); //output : 25 ASP.NET (C# example)
  • 42. Function arguments • You can define any number of arguments to an ASP.NET function. • Arguments can be passed by reference(byRef) or by value (byValue) o byRef - When an argument is passed by reference, the called procedure can change the value of the variable. The change persists after the procedure is called o byValue - When an argument is passed by value, any changes that the called procedure makes to the value of the variable do not persist after the procedure is called.
  • 43. Function return type • The function return type can also be defined in the function declaration – VB.net Function findSum(byval a as integer, byval b as integer) as integer Dim c as integer c=a+b Return c End function – C# public int findSum(int a, int b) { int c; c = (a + b); return c; }
  • 44. Function return type • A function without a return value is called as a sub routine and is defined as follows in ASP.NET – Vb.net private sub findSum(byval a as integer, byval b as integer) Dim c as integer c=a+b End sub – C# Protected void findSum(int a, int b) { int c; c=a+b; }
  • 45. Strings Char a*+=‚Baabtra‛; Printf(‚Hello %s‛,a); Dim a as string =‚Baabtra‛ Response.write( ‚Hello ‛ + a) //Output: Hello baabtra Response.write( ‚Hello + a‛) //Output: Hello + a ‚Strings will be continued in coming chapters‛ C ASP.NET
  • 46. Arrays Indexed Array int a[]={1,2,3,4,5,6,7,8,9,10}; for(i=0;i<10;i++) Printf(‚%d‛,a[i]); ‚Array will be continued in coming chapters‛ Declaring an array of strings Vb.net Dim arrStr as string() //without initialisation Dim arrStr as string() = (‚a‛, ‚b‛) //with initialisation C# string[] arrStr ;//without initialisation string[] arrStr = new string[] { "one", "two", "three" } //with initialisation C ASP.NET
  • 48. Operators C Arithmetic Operators +, ++, -, --, *, /, % Comparison Operators ==, !=, ===, !==, >, >=, < , <= Logical Operators &&, ||, ! Assignment Operators =, +=, -=, *=, /=, %= ASP.NET Arithmetic Operators Ope rato r description Example Re sul t + Addition myNum = 3 + 4 7 - Subtraction myNum = 4 - 3 1 * Multiplication myNum = 3 * 4 12 / Division myNum = 12 /4 3 ^ Exponential myNum = 2 ^ 4 16 Mod Modulus myNum = 23 Mod 10 3 - Negation myNum = -10 -10 Integer Division myNum = 9 3 3
  • 49. Comparison operators Operator description Example Result = Equal to 3 = 4 false < Less than 4 < 3 false > Greater than 4 > 3 true <= Less than or equal to 4 <= 4 true >= Greater than or equal to 4 >= 5 false <> / != Not equal to 4 <> 3 / 4 != 3 true
  • 50. Logical operators Operator description Example Result And / && Both Must be TRUE True And False false Or / || One Must be TRUE True Or False true Not / ! Flips Truth Value Not true false String operators Operator description Example Result & / + String Concatenation string4 = “Hello" & " world" string4 = “Hello world"
  • 51. • Bitwise operators allow you to manipulate bits of data. All these operators are designed to work only on integer numbers—therefore, the interpreter will attempt to convert their operands to integers before executing them. Bitwise Operators AND Bitwise AND. The result of the operation will be a value whose bits are set if they are set in both operands, and unset otherwise. OR Bitwise OR. The result of the operation will be a value whose bits are set if they are set in either operand (or both), and unset otherwise. XOR Bitwise XOR (exclusive OR). The result of the operation will be a value whose bits are set if they are set in either operand, and unset otherwise. NOT Bitwise NOT. inverts each bit in a sequence of bits. A 0 becomes a 1, and a 1 becomes a 0. << Bitwise left shift. This operation shifts the left-hand operand’s bits to the left by a number of positions equal to the right operand, inserting unset bits in the shifted positions >> Bitwise right shift. This operation shifts the left-hand operand’s bits to the right by a number of positions equal to the right operand, inserting unset bits in the shifted positions.
  • 53. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  • 54. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com