Web Server Programming
Download
Report
Transcript Web Server Programming
Visual Studio
Creating a Simple ASP.NET Application
Content
The .NET Framework
Visual Studio 2012 Environment
A Simple ASP.NET Web Application
Muzaffer DOĞAN - Anadolu University
2
Muzaffer DOĞAN - Anadolu University
3
The .NET Framework
.NET Framework is a cluster of several technologies:
.NET Languages: C#, Visual Basic.NET, JScript.NET, J#,
C++
The Common Language Runtime (CLR): The engine
that executes all .NET programs
The .NET Framework Class Library: The class library
for many prebuilt functionality (e.g. ADO.NET,
Windows Forms, etc.)
ASP.NET
Visual Studio.NET
Muzaffer DOĞAN - Anadolu University
4
.NET Languages
C# is designed for .NET technology
C# and VB.NET uses the same .NET library
C# and VB.NET codes are very similar
VB6.0 and VB.NET are different languages because
VB.NET is an object-oriented language
A C# programmer can easily understand and convert
VB.NET programs
Muzaffer DOĞAN - Anadolu University
5
Intermediate Language (IL)
All .NET languages are compiled into another low-
level language before the code is executed
This lower-level language is the Common
Intermediate Language (CIL, or just IL)
Because of this feature, C# programs can use VB.NET
(or any other .NET language) components
Every EXE or DLL file built with a .NET language
contains IL code
.NET Framework should be installed on the computer
that the .NET program is deployed
Muzaffer DOĞAN - Anadolu University
6
Compilation
Muzaffer DOĞAN - Anadolu University
7
Execution
Muzaffer DOĞAN - Anadolu University
8
.NET Class Library
Muzaffer DOĞAN - Anadolu University
9
Common Language Runtime (CLR)
Muzaffer DOĞAN - Anadolu University
10
History of .NET
Muzaffer DOĞAN - Anadolu University
11
.NET Framework Versions
Muzaffer DOĞAN - Anadolu University
12
What’s New in the .NET Framework
Muzaffer DOĞAN - Anadolu University
13
Muzaffer DOĞAN - Anadolu University
14
ASP.NET Versions
ASP.NET 1.0: First release
ASP.NET 1.1: Added performance, bug-fixes but no new
features
ASP.NET 2.0: Prebuilt goodies that developers can use
without writing much code. New features: Website
navigation, easier database access, theming for web
page design
ASP.NET 3.5: Embedded Ajax, LINQ
Muzaffer DOĞAN - Anadolu University
15
Now, in this course?
In this course, we’ll be developing
ASP.NET 4.5 applications
over .NET Framework 4.5
on Visual Studio 2012
using C# 5.0.
Muzaffer DOĞAN - Anadolu University
16
Muzaffer DOĞAN - Anadolu University
17
Visual Studio Features
Page Design: Drag & drop style; you don’t need to
understand HTML
Automatic Error Detection
Debugging Tools
Intellisense: Statement completion for recognized
objects and listing information automatically
Muzaffer DOĞAN - Anadolu University
18
Visual Studio 2012
A powerful integrated development environment (IDE)
Automates the steps required to compile source code
Intelligently detect errors and suggest code where
appropriate as you are typing (Intellisense)
Includes designers, enabling simple drag&drop design of
UI elements
Includes starter projects
Enables deployment
Enables debugging
etc.
19
Visual Studio Versions
Visual Studio Professional
Visual Studio Premium
Visual Studio Ultimate
Visual Studio Express Edition: Free, but some features
are absent
Visual C# Express: Contains only C#
Visual Web Developer Express: Contains only web
application tools
20
Visual Studio Solutions
You create solutions in Visual Studio
Solutions contain projects
Solutions can contain multiple projects
This enables you to work on shared code
21
Solution
Explorer
Toolbox
Designer
Properties
Window
22
Solution
Project
Source Files
Source Code
23
24
Do NOT select
File -> New ->
Project ->
ASP.NET Web
Forms
Application
25
26
Right-click the project name
and select Add -> Add New
Item
(equivalently: Add -> Web
Form)
27
28
Switch to Design View
29
Put a Label, press the Enter key,
and put a Button
30
Double-click the button
31
Write the code and press Ctrl-F5
32
Click the button
33
34