intro to asp.net

23
Intro to ASP.NET By Slaveyko Ingilizov

Upload: information-technology

Post on 07-May-2015

4.768 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Intro to asp.net

Intro to ASP.NETBy Slaveyko Ingilizov

Page 2: Intro to asp.net

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

Page 3: Intro to asp.net

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

Page 4: Intro to asp.net

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

Page 5: Intro to asp.net

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

Page 6: Intro to asp.net

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 …

Page 7: Intro to asp.net

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

Page 8: Intro to asp.net

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

Page 9: Intro to asp.net

11 Oct 2006 Intro to ASP.NET 9

IIS Installation and Configuration Demo

Page 10: Intro to asp.net

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

Page 11: Intro to asp.net

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/>

Page 12: Intro to asp.net

11 Oct 2006 Intro to ASP.NET 12

Basic Syntax Demo

Page 13: Intro to asp.net

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;

}

}

Page 14: Intro to asp.net

11 Oct 2006 Intro to ASP.NET 14

Code-behind Demo

Page 15: Intro to asp.net

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”

Page 16: Intro to asp.net

11 Oct 2006 Intro to ASP.NET 16

Server Controls Demo

Page 17: Intro to asp.net

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

Page 18: Intro to asp.net

11 Oct 2006 Intro to ASP.NET 18

Validation Controls Demo

Page 19: Intro to asp.net

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

Page 20: Intro to asp.net

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/

Page 21: Intro to asp.net

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…

Page 22: Intro to asp.net

11 Oct 2006 Intro to ASP.NET 22

Thank you!

Page 23: Intro to asp.net

11 Oct 2006 Intro to ASP.NET 23

Questions?