SlideShare a Scribd company logo
PROGRAMMING LANGUAGES
SUMMER 2015
ASP.NET
ASP ?
 ASP stands for Active Server Pages.
 ASP.NET is a web application framework developed by Microsoft to
allow programmers to build dynamic web sites.
 An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are executed on the server.
 ASP is a Microsoft Technology that runs inside IIS.
 IIS is the web server created by Microsoft for use with Windows NTfamily.
 To run IIS you must have Windows NT 4.0 or later.
 ChiliASP and InstantASP are two technology’s which runs ASP without Windows.
History
 After four years of development, and a series of beta releases in 2000 and 2001, ASP.NET 1.0 was
released on January 5, 2002 as part of version 1.0 of the .NET Framework.
 ASP.NETis a new ASP generation.
 ASP.NETis the successor to Microsoft'sActive ServerPages(ASP) technology.ASP.NET is built on
the Common Language Runtime (CLR), allowing programmers to write ASP.NETcode using any
supported .NETlanguage.
ASP.NET Versions
ASP.NETVersion Introducedwith .NET& IDE
4.5.1 4.5.1andVisual Studio2013
4.5 4.5andVisual Studio2012
4.0 4.0andVisual Studio2010
3.5 3.5andVisual Studio2008
2.0 2.0andVisual Studio2005
1.1 1.1andVisual Studio.NET2003
1.0 1.0andVisual Studio.NET
Compilers
 ASP.NETIntellisense Generator
 Microsoft Visual Studio
 Microsoft Visual Web Developer Express
 Microsoft SharePoint Designer
 MonoDevelop
 SharpDevelop
 Adobe Dreamweaver
 CodeGear Delphi
What can ASP do foryou?
 Websites that require user requests to be processed atserver side can be developed using asp.net.
 Access any data or databases and return the results to a browser.
 To build an Internet applicationthat supports adding, editing, deleting, and listing of information stored
in a database.
 Customize a Web page to make it more useful for individual users.
 Applications
ASP.NET Models
 ASP.NETsupports three different development models:
 Web Pages:
 Web Pagesis the easiest development model fordeveloping ASP.NET web sites.
 MVC (Model View Controller):
 MVC is a model for building web applications using a MVC (Model ViewController) design.
 Web Forms:
 Web Forms is the traditional ASP.NET model, based on event driven Web Forms and post backs.
Code-behind model
 It encourages developers to build applicationswithseparation of presentation and content in mind.
 In theory, this would allowa web designer, for example, to focus on the design markup with less
potential for disturbing the programming code that drives it.
 This is similar to the separation of the controller from the view in Model–View–Controller (MVC)
frameworks.
 Using "code behind" separates the presentation logic from UI visualization.
Program Structure
 ASP.NETpages have the extension .aspx, and are normally written in VB (Visual Basic)
or C# (C sharp).
 Razor is a new and simple markup syntax for embedding server code into ASP.NETweb
pages.
Data Types and Data Types
Youdon'thavetospecifya typeforavariable.
Mostofthetime,ASP.NETcan figureoutthetypebasedon howthedatainthevariableisbeingused.
//Assigningastringtoa variable.
vargreeting= "Welcome!";
//Assigninganumbertoavariable.
vartheCount= 3;
//Assigninganexpressiontoavariable.
varmonthlyTotal= theCount+5;
//Assigningadatevaluetoa variable.
vartoday=DateTime.Today;
//Declaringvariablesusingexplicitdatatypes.
stringname= "Joe";
intcount= 5;
DateTimetomorrow=DateTime.Now.AddDays(1);
Razor Syntax Rules forC#
 Razor code blocks are enclosed in @{ ...}
 Inline expressions (variables and functions) start with @
 Code statements end with semicolon
 Variables are declared withthe var keyword
 Strings are enclosed with quotation marks
 C# code is case sensitive
 C# files have the extension .cshtml
C# Code
 <html>
 <body>
 <!-- Single statement block -->
@{{ varmyMessage ="Hello World"; }

<!-- Inline expression orvariable -->
<p>The value of myMessage is: @myMessage</p>
<!-- Multi-statement block -->
@{{
vargreeting ="Welcome tooursite!";
varweekDay =DateTime.Now.DayOfWeek;
vargreetingMessage =greeting +"Today is: " + weekDay; }
}
<p>The greeting is: @greetingMessage</p>
 </body>
 </html>
Output
Razor Syntax Rules forVB
 Razor code blocks are enclosed in @Code ...End Code
 Inline expressions (variables and functions) start with @
 Variables are declared with the Dim keyword
 Strings are enclosed withquotation marks
 VB code is not case sensitive
 VB files have the extension .vbhtml
VB Code
html>
<body>
<!-- Single statement block -->
@Code
dim myMessage ="Hello World"
End Code
<!-- Inline expression orvariable -->
<p>The value of myMessage is: @myMessage</p>
<!-- Multi-statement block -->
@Code
dim greeting ="Welcome toour site!"
dimweekDay =DateTime.Now.DayOfWeek
dimgreetingMessage =greeting &" Today is: " &weekDay
End Code
<p>The greeting is: @greetingMessage</p>
</body>
</html>
Expressions,AssignmentStatements
 Expressions
 @(5 + 13) @{ var netWorth = 150000; }
 @{ var newTotal = netWorth * 2; }
 @(newTotal / 2)
 Assignment Statements
 var age = 17;
Conditional Statements
@{
var txt = "";
if(DateTime.Now.Hour > 12)
{txt = "Good Evening";}
else
{txt = "Good Morning";}
}
<html>
<body>
<p>Themessage is @txt</p>
</body>
</html>
Output
Objects, Methods
 "Date" object is a typical built-in ASP.NETobject.
 Objects can also be self-defined.
 Examples:a web page, a text box, a file, a database record, etc.
 Objects may have methods they can perform.
 Examples:A database record might have a "Save" method, an image object might have
a "Rotate" method, an emailobject might have a "Send" method, and so on.
 Objects also have properties that describe their characteristics.
 Examples:A database record might have a FirstName and a LastName property
(amongst others).
Example:
<table border="1">
<tr>
<th width="100px">Name</th>
<td width="100px">Value</td>
</tr>
<tr>
<td>Day</td><td>@DateTime.Now.Day</td>
</tr>
<tr>
<td>Hour</td><td>@DateTime.Now.Hour</td>
</tr>
<tr>
<td>Minute</td><td>@DateTime.Now.Minute</td>
</tr>
</td>
</table>
Output
Inheritance
 All managedlanguagesinthe.NETFramework,suchasVisualBasicandC#,providefullsupportforobject-orientedprogrammingincludingencapsulation,inheritance,
andpolymorphism.
 Inheritancedescribestheabilitytocreatenewclassesbasedonanexistingclass.
public class A
{
public A() {{ }
}
public class B: A
{
public B() { }
}
Inheritance Example
Encapsulation
 Encapsulation means that a group of related properties, methods, and other members
are treated as a single unit or object.
 Encapsulation is implemented by using access specifiers.
 An access specifierdefines the scope and visibility of a classmember.
 C# supports the following access specifiers:
Example
using System;
class BankAccountPublic
{
public decimal GetAmount()
{
return 1000.00m;
}
}
The GetAmount() method is public meaning that it can be called by code that is external to this class. elsewhere in your program,touse the method.
BankAccountPublic bankAcctPub = new BankAccountPublic();
// call a public method
decimal amount = bankAcctPub.GetAmount();
Add Two Numbers
@{{
var totalMessage = "";
if(IsPost)
{{
var num1 = Request["text1"];
var num2 = Request["text2"];
var total = num1.AsInt() + num2.AsInt();
totalMessage = "Total = " + total;
}} }
}} }
}
<!DOCTYPE html>
<html>
<body style="background-color: beige; font-family: Verdana, Arial;">
<form action="" method="post">
<p><label for="text1">First Number:</label><br>
<input type="text" name="text1"></p>
<p><label for="text2">Second Number:</label><br>
<input type="text" name="text2"></p>
<p><input type="submit" value=" Add "></p>
</form>
<p>@totalMessage</p>
</body>
</html>
Output
Resources
 http://www.w3schools.com
 http://www.dotnet-tricks.com/Tutorial/aspnet/3JEV171213-A-brief-version-history-of-ASP.NET.html
 http://forums.asp.net
 http://www.asp.net/web-pages/overview/getting-started/introducing-razor-syntax-%28c%29
THANK YOU

More Related Content

What's hot (20)

PPTX
Presentation about html5 css3
Gopi A
 
PDF
Ncp computer appls web tech asish
NCP
 
PPTX
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Ayes Chinmay
 
PPTX
Front End Development | Introduction
JohnTaieb
 
PPTX
Css introduction
AbhishekMondal42
 
PPTX
INTRODUCTIONS OF CSS
SURYANARAYANBISWAL1
 
PPT
A quick guide to Css and java script
AVINASH KUMAR
 
PDF
CSS3 Introduction
Jaeni Sahuri
 
PDF
HTML 5 Step By Step - Ebook
Scottperrone
 
PDF
HTML CSS Basics
Mai Moustafa
 
PDF
Intro to HTML & CSS
Syed Sami
 
PPTX
Web Development Today
bretticus
 
PPTX
Dhtml
Sadhana28
 
PDF
HTML/CSS Crash Course (april 4 2017)
Daniel Friedman
 
PPTX
Web1O1 - Intro to HTML/CSS
NYCSS Meetup
 
PDF
Intro to mobile web application development
zonathen
 
PDF
Frontend Crash Course: HTML and CSS
Thinkful
 
PPTX
Web technologies part-2
Michael Anthony
 
PPTX
Css, xhtml, javascript
Trần Khải Hoàng
 
PPT
Framework
vinoth kumar
 
Presentation about html5 css3
Gopi A
 
Ncp computer appls web tech asish
NCP
 
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Ayes Chinmay
 
Front End Development | Introduction
JohnTaieb
 
Css introduction
AbhishekMondal42
 
INTRODUCTIONS OF CSS
SURYANARAYANBISWAL1
 
A quick guide to Css and java script
AVINASH KUMAR
 
CSS3 Introduction
Jaeni Sahuri
 
HTML 5 Step By Step - Ebook
Scottperrone
 
HTML CSS Basics
Mai Moustafa
 
Intro to HTML & CSS
Syed Sami
 
Web Development Today
bretticus
 
Dhtml
Sadhana28
 
HTML/CSS Crash Course (april 4 2017)
Daniel Friedman
 
Web1O1 - Intro to HTML/CSS
NYCSS Meetup
 
Intro to mobile web application development
zonathen
 
Frontend Crash Course: HTML and CSS
Thinkful
 
Web technologies part-2
Michael Anthony
 
Css, xhtml, javascript
Trần Khải Hoàng
 
Framework
vinoth kumar
 

Viewers also liked (16)

PPT
Microsoft .NET Development Platform Internationalization
Rishi Kothari
 
PPTX
ASP.NET Web Stack
Ugo Lattanzi
 
PPT
Migration from ASP to ASP.NET
Information Technology
 
PPS
Asp Architecture
Om Vikram Thapa
 
PPT
Asp.net architecture
Iblesoft
 
PPTX
Tomamos decisiones
Andreafernandezpenalver
 
PPTX
Quality Premiums - Deep dive GBAF03
Matthew Cunningham
 
PDF
Epidemiologia da ivc
Suzana326
 
DOC
JULIANA_BACCHUS_RESUME 2015
Juliana Bacchus
 
PDF
Trump Presentation
Rani Sharda
 
PDF
Religion grado 5
miriam rodriguez
 
PDF
Caring Together deep dive risk240
Matthew Cunningham
 
PPTX
Why we travel
Amanvana Spa Resort
 
PDF
Professional Resume
Harriet Harrison Oakley
 
PPTX
CAB.PPTX
Praveen Soni
 
Microsoft .NET Development Platform Internationalization
Rishi Kothari
 
ASP.NET Web Stack
Ugo Lattanzi
 
Migration from ASP to ASP.NET
Information Technology
 
Asp Architecture
Om Vikram Thapa
 
Asp.net architecture
Iblesoft
 
Tomamos decisiones
Andreafernandezpenalver
 
Quality Premiums - Deep dive GBAF03
Matthew Cunningham
 
Epidemiologia da ivc
Suzana326
 
JULIANA_BACCHUS_RESUME 2015
Juliana Bacchus
 
Trump Presentation
Rani Sharda
 
Religion grado 5
miriam rodriguez
 
Caring Together deep dive risk240
Matthew Cunningham
 
Why we travel
Amanvana Spa Resort
 
Professional Resume
Harriet Harrison Oakley
 
CAB.PPTX
Praveen Soni
 
Ad

Similar to Programming languages asp.net (20)

PDF
ASP.NET And Web Programming
Kimberly Pulley
 
PPTX
Introduction to C#
Lee Englestone
 
PPTX
Asp.net
vijilakshmi51
 
PPTX
ASP.pptx
GlenardDSarmiento
 
PPTX
ASP.pptx
SwapnilPawar483968
 
PPT
Aspintro
ambar chakraborty
 
PPT
Introaspnet
Nagaraju Yajjuvarapu
 
PPT
Introduction to ASP.net. It provides basic introduction
ssuserbf6ebe
 
PPT
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
AvijitChaudhuri3
 
PPT
introaspnet.ppt
asmachehbi
 
PPT
introaspnet.ppt
IbrahimBurhan6
 
PPTX
Introduction to asp
Madhuri Kavade
 
PDF
Asp.net web application framework management system.pdf
Kamal Acharya
 
DOCX
As pnet
Abhishek Kesharwani
 
DOC
Asp.Net Tutorials
Ram Sagar Mourya
 
PPT
This is the introduction to Asp.Net Using C# Introduction Variables State Man...
sagar490070
 
PPT
INTRODUCTION TO ASP.NET COMPLETE MATERIALCOURSE
passtime0530
 
PPTX
Intro to .NET for Government Developers
Frank La Vigne
 
PDF
Advanced Web Programming_UNIT_1_NewSyllabus.pdf
ansariparveen06
 
PDF
Advanced Web Programming_UNIT_1_NewSyllabus.pdf
ansariparveen06
 
ASP.NET And Web Programming
Kimberly Pulley
 
Introduction to C#
Lee Englestone
 
Asp.net
vijilakshmi51
 
Introduction to ASP.net. It provides basic introduction
ssuserbf6ebe
 
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
AvijitChaudhuri3
 
introaspnet.ppt
asmachehbi
 
introaspnet.ppt
IbrahimBurhan6
 
Introduction to asp
Madhuri Kavade
 
Asp.net web application framework management system.pdf
Kamal Acharya
 
Asp.Net Tutorials
Ram Sagar Mourya
 
This is the introduction to Asp.Net Using C# Introduction Variables State Man...
sagar490070
 
INTRODUCTION TO ASP.NET COMPLETE MATERIALCOURSE
passtime0530
 
Intro to .NET for Government Developers
Frank La Vigne
 
Advanced Web Programming_UNIT_1_NewSyllabus.pdf
ansariparveen06
 
Advanced Web Programming_UNIT_1_NewSyllabus.pdf
ansariparveen06
 
Ad

Recently uploaded (20)

PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Digital Circuits, important subject in CS
contactparinay1
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 

Programming languages asp.net

  • 2. ASP ?  ASP stands for Active Server Pages.  ASP.NET is a web application framework developed by Microsoft to allow programmers to build dynamic web sites.  An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are executed on the server.  ASP is a Microsoft Technology that runs inside IIS.  IIS is the web server created by Microsoft for use with Windows NTfamily.  To run IIS you must have Windows NT 4.0 or later.  ChiliASP and InstantASP are two technology’s which runs ASP without Windows.
  • 3. History  After four years of development, and a series of beta releases in 2000 and 2001, ASP.NET 1.0 was released on January 5, 2002 as part of version 1.0 of the .NET Framework.  ASP.NETis a new ASP generation.  ASP.NETis the successor to Microsoft'sActive ServerPages(ASP) technology.ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NETcode using any supported .NETlanguage.
  • 4. ASP.NET Versions ASP.NETVersion Introducedwith .NET& IDE 4.5.1 4.5.1andVisual Studio2013 4.5 4.5andVisual Studio2012 4.0 4.0andVisual Studio2010 3.5 3.5andVisual Studio2008 2.0 2.0andVisual Studio2005 1.1 1.1andVisual Studio.NET2003 1.0 1.0andVisual Studio.NET
  • 5. Compilers  ASP.NETIntellisense Generator  Microsoft Visual Studio  Microsoft Visual Web Developer Express  Microsoft SharePoint Designer  MonoDevelop  SharpDevelop  Adobe Dreamweaver  CodeGear Delphi
  • 6. What can ASP do foryou?  Websites that require user requests to be processed atserver side can be developed using asp.net.  Access any data or databases and return the results to a browser.  To build an Internet applicationthat supports adding, editing, deleting, and listing of information stored in a database.  Customize a Web page to make it more useful for individual users.  Applications
  • 7. ASP.NET Models  ASP.NETsupports three different development models:  Web Pages:  Web Pagesis the easiest development model fordeveloping ASP.NET web sites.  MVC (Model View Controller):  MVC is a model for building web applications using a MVC (Model ViewController) design.  Web Forms:  Web Forms is the traditional ASP.NET model, based on event driven Web Forms and post backs.
  • 8. Code-behind model  It encourages developers to build applicationswithseparation of presentation and content in mind.  In theory, this would allowa web designer, for example, to focus on the design markup with less potential for disturbing the programming code that drives it.  This is similar to the separation of the controller from the view in Model–View–Controller (MVC) frameworks.  Using "code behind" separates the presentation logic from UI visualization.
  • 9. Program Structure  ASP.NETpages have the extension .aspx, and are normally written in VB (Visual Basic) or C# (C sharp).  Razor is a new and simple markup syntax for embedding server code into ASP.NETweb pages.
  • 10. Data Types and Data Types Youdon'thavetospecifya typeforavariable. Mostofthetime,ASP.NETcan figureoutthetypebasedon howthedatainthevariableisbeingused. //Assigningastringtoa variable. vargreeting= "Welcome!"; //Assigninganumbertoavariable. vartheCount= 3; //Assigninganexpressiontoavariable. varmonthlyTotal= theCount+5; //Assigningadatevaluetoa variable. vartoday=DateTime.Today; //Declaringvariablesusingexplicitdatatypes. stringname= "Joe"; intcount= 5; DateTimetomorrow=DateTime.Now.AddDays(1);
  • 11. Razor Syntax Rules forC#  Razor code blocks are enclosed in @{ ...}  Inline expressions (variables and functions) start with @  Code statements end with semicolon  Variables are declared withthe var keyword  Strings are enclosed with quotation marks  C# code is case sensitive  C# files have the extension .cshtml
  • 12. C# Code  <html>  <body>  <!-- Single statement block --> @{{ varmyMessage ="Hello World"; }  <!-- Inline expression orvariable --> <p>The value of myMessage is: @myMessage</p> <!-- Multi-statement block --> @{{ vargreeting ="Welcome tooursite!"; varweekDay =DateTime.Now.DayOfWeek; vargreetingMessage =greeting +"Today is: " + weekDay; } } <p>The greeting is: @greetingMessage</p>  </body>  </html>
  • 14. Razor Syntax Rules forVB  Razor code blocks are enclosed in @Code ...End Code  Inline expressions (variables and functions) start with @  Variables are declared with the Dim keyword  Strings are enclosed withquotation marks  VB code is not case sensitive  VB files have the extension .vbhtml
  • 15. VB Code html> <body> <!-- Single statement block --> @Code dim myMessage ="Hello World" End Code <!-- Inline expression orvariable --> <p>The value of myMessage is: @myMessage</p> <!-- Multi-statement block --> @Code dim greeting ="Welcome toour site!" dimweekDay =DateTime.Now.DayOfWeek dimgreetingMessage =greeting &" Today is: " &weekDay End Code <p>The greeting is: @greetingMessage</p> </body> </html>
  • 16. Expressions,AssignmentStatements  Expressions  @(5 + 13) @{ var netWorth = 150000; }  @{ var newTotal = netWorth * 2; }  @(newTotal / 2)  Assignment Statements  var age = 17;
  • 17. Conditional Statements @{ var txt = ""; if(DateTime.Now.Hour > 12) {txt = "Good Evening";} else {txt = "Good Morning";} } <html> <body> <p>Themessage is @txt</p> </body> </html>
  • 19. Objects, Methods  "Date" object is a typical built-in ASP.NETobject.  Objects can also be self-defined.  Examples:a web page, a text box, a file, a database record, etc.  Objects may have methods they can perform.  Examples:A database record might have a "Save" method, an image object might have a "Rotate" method, an emailobject might have a "Send" method, and so on.  Objects also have properties that describe their characteristics.  Examples:A database record might have a FirstName and a LastName property (amongst others).
  • 20. Example: <table border="1"> <tr> <th width="100px">Name</th> <td width="100px">Value</td> </tr> <tr> <td>Day</td><td>@DateTime.Now.Day</td> </tr> <tr> <td>Hour</td><td>@DateTime.Now.Hour</td> </tr> <tr> <td>Minute</td><td>@DateTime.Now.Minute</td> </tr> </td> </table>
  • 22. Inheritance  All managedlanguagesinthe.NETFramework,suchasVisualBasicandC#,providefullsupportforobject-orientedprogrammingincludingencapsulation,inheritance, andpolymorphism.  Inheritancedescribestheabilitytocreatenewclassesbasedonanexistingclass. public class A { public A() {{ } } public class B: A { public B() { } }
  • 24. Encapsulation  Encapsulation means that a group of related properties, methods, and other members are treated as a single unit or object.  Encapsulation is implemented by using access specifiers.  An access specifierdefines the scope and visibility of a classmember.  C# supports the following access specifiers:
  • 25. Example using System; class BankAccountPublic { public decimal GetAmount() { return 1000.00m; } } The GetAmount() method is public meaning that it can be called by code that is external to this class. elsewhere in your program,touse the method. BankAccountPublic bankAcctPub = new BankAccountPublic(); // call a public method decimal amount = bankAcctPub.GetAmount();
  • 26. Add Two Numbers @{{ var totalMessage = ""; if(IsPost) {{ var num1 = Request["text1"]; var num2 = Request["text2"]; var total = num1.AsInt() + num2.AsInt(); totalMessage = "Total = " + total; }} } }} } } <!DOCTYPE html> <html> <body style="background-color: beige; font-family: Verdana, Arial;"> <form action="" method="post"> <p><label for="text1">First Number:</label><br> <input type="text" name="text1"></p> <p><label for="text2">Second Number:</label><br> <input type="text" name="text2"></p> <p><input type="submit" value=" Add "></p> </form> <p>@totalMessage</p> </body> </html>
  • 28. Resources  http://www.w3schools.com  http://www.dotnet-tricks.com/Tutorial/aspnet/3JEV171213-A-brief-version-history-of-ASP.NET.html  http://forums.asp.net  http://www.asp.net/web-pages/overview/getting-started/introducing-razor-syntax-%28c%29