intro to asp.net
TRANSCRIPT
Intro to ASP.NETBy Slaveyko Ingilizov
11 Oct 2006 Intro to ASP.NET 2
Outline
What is ASP.NET What do we need to start Pros and Cons What’s new in ASP.NET 2.0 Architecture Syntax Server Controls Code-behind Validation Controls
11 Oct 2006 Intro to ASP.NET 3
What is ASP.NET?
Successor of ASP (Active Server Pages)
ASP.NET is not a scripting language or a programming language
“Programming framework built on the common language runtime that can be used on a server to build powerful web applications” - Microsoft
11 Oct 2006 Intro to ASP.NET 4
What do we need?
Web Server IIS 5 / IIS 6 (Internet Information
Services) Apache (using mod_mono from MONO
project) XSP standalone web server, also from
MONO
.NET Framework Text editor or IDE
11 Oct 2006 Intro to ASP.NET 5
Pros and Cons
Better performance – Compiled code
.NET Framework class library Multi language support Simplicity Separation of logic and
presentation
11 Oct 2006 Intro to ASP.NET 6
What’s new in ASP.NET 2.0 New Server Controls Master Pages Themes and Skins 64-bit Support Caching Improvements Admin and Management Tools …
11 Oct 2006 Intro to ASP.NET 7
ASP.NET Architecture
Web clients (browsers) communicate with IIS
IIS communicates with ASP.NET engine
The ASP.NET engine communicates with the .NET Framework
11 Oct 2006 Intro to ASP.NET 8
ASP.NET Page Processing Browser makes a HTTP request The web server (IIS) receives the request IIS examines the request and routes it to
the appropriate engine ASP.NET engine generates output and
sends it back to the browser
11 Oct 2006 Intro to ASP.NET 9
IIS Installation and Configuration Demo
11 Oct 2006 Intro to ASP.NET 10
Recap
What is ASP.NET What do we need to start Pros and Cons What’s new in ASP.NET 2.0 Architecture Syntax Server Controls Code-behind Validation Controls
11 Oct 2006 Intro to ASP.NET 11
Basic Syntax
ASP-like: <% … %><% for (int i=3; i<7; i++) { %>
<font size="<%=i%>">Welcome to ASP.NET</font> <br/>
<% } %>
<font size="3">Welcome to ASP.NET</font> <br/>
<font size="4">Welcome to ASP.NET</font> <br/>
<font size="5">Welcome to ASP.NET</font> <br/>
<font size="6">Welcome to ASP.NET</font> <br/>
11 Oct 2006 Intro to ASP.NET 12
Basic Syntax Demo
11 Oct 2006 Intro to ASP.NET 13
Code-behind
Not present in old ASP Separates logic from
presentation<%@ page language="C#" CodeFile="CodeBehind_cs.aspx.cs" Inherits="CodeBehind_cs_aspx" %>
using System;
public class CodeBehind_cs_aspx : System.Web.UI.Page {
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = "Hello " + TextBox1.Text;
}
}
11 Oct 2006 Intro to ASP.NET 14
Code-behind Demo
11 Oct 2006 Intro to ASP.NET 15
Server Controls
Look just like HTML form controls Retain their values after
postback Control’s Attributes can be
Accessed on the Server Available to use from the .NET
class library Need two attributes:
ID=“name_of_control” runat=“server”
11 Oct 2006 Intro to ASP.NET 16
Server Controls Demo
11 Oct 2006 Intro to ASP.NET 17
Validation Controls
New in ASP.NET Perform form input validation Several types:
Required Field Validator Range Validator Compare Validator Regular Expression Validator Custom Validator Validation Summary
11 Oct 2006 Intro to ASP.NET 18
Validation Controls Demo
11 Oct 2006 Intro to ASP.NET 19
What next?
Data access using ADO.NET Styles, themes and skins Master Pages Security Caching Site Navigation
11 Oct 2006 Intro to ASP.NET 20
References http://www.asp.net http://www.directionsonmicrosoft.com/ http://aspalliance.com http://aspnet.4guysfromrolla.com/ http://www.123aspx.com/ http://www.aspnetresources.com/ http://www.aspexperts.com/ http://www.dotnetspider.com/
tutorials/AspNet-Tutorials.aspx http://www.15seconds.com/ http://www.aspdev.org/
11 Oct 2006 Intro to ASP.NET 21
References Cont’d ASP.NET Cookbook - Michael Kittel,
Geoffrey LeBlond C# .NET Web Developer’s Guide –
Adrian Turtschi, Jason Werry … C# Developer’s Guide to ASP.NET,
XML and ADO.NET – Jeffrey McManus, Chris Kinsman
Essential ASP.NET with Examples in C# - Fritz Onion
ASP.NET: Tips, Tutorials and Code – Scott Mitchell, Bill Anders…
11 Oct 2006 Intro to ASP.NET 22
Thank you!
11 Oct 2006 Intro to ASP.NET 23
Questions?