15
Active Server Pages (ASP.NET) Manzoor Ahmad Mubashir Muhamad Yousaf Shahzad Gul Presented By

Active Server Pages (ASP.NET)€¦ · server-side scripts, along with HTML, XML or other text. ASP page has an extension .asp •Default scripting language is VBScript. Other scripting

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Active Server Pages (ASP.NET)€¦ · server-side scripts, along with HTML, XML or other text. ASP page has an extension .asp •Default scripting language is VBScript. Other scripting

Active Server Pages (ASP.NET)

Manzoor Ahmad MubashirMuhamad Yousaf

Shahzad Gul

Presented By

Page 2: Active Server Pages (ASP.NET)€¦ · server-side scripts, along with HTML, XML or other text. ASP page has an extension .asp •Default scripting language is VBScript. Other scripting

Agenda• Classic ASP

• ASP & HTML

• What is .NET?

• ASP.NET

• Differences between ASP & ASP.NET

• WHY ASP.NET?

• ASP.NET Architecture

• Dynamic page creation by ASP.NET

Page 3: Active Server Pages (ASP.NET)€¦ · server-side scripts, along with HTML, XML or other text. ASP page has an extension .asp •Default scripting language is VBScript. Other scripting

ASP (Active Server Pages)• First server-side script engine developed and

released by Microsoft in December 1996.

• Used to create dynamic & interactive webapplications.

• ASP Page is a simple HTML page containingserver-side scripts, along with HTML, XML or othertext. ASP page has an extension .asp

• Default scripting language is VBScript. Otherscripting engines (JScript, PerlScript etc) can beselected.

• ASP uses the Microsoft’s web server (InternetInformation Services/Server)

• ASP pages are processed by IIS before being sentto the user's browser.

Page 4: Active Server Pages (ASP.NET)€¦ · server-side scripts, along with HTML, XML or other text. ASP page has an extension .asp •Default scripting language is VBScript. Other scripting

• A Simple ASP page

<%@ Language=VBScript %> //not necessary if default language to be used is VB

<html>

<title>ABCD</title>

<body>

<%

Var = "Hello World!“

%>

<%=Var%>

</body>

</html>

Create a new folder underC:\Inetpub\Wwwroot (Configure IIS first!)

Save at C:\Inetpub\Wwwroot\New Folder\new_file.asp

Run the file in any web browser.

HTML/Text File

(.htm, .html, .txt)

ASP Page

(.asp)

Change File Extension

Page 5: Active Server Pages (ASP.NET)€¦ · server-side scripts, along with HTML, XML or other text. ASP page has an extension .asp •Default scripting language is VBScript. Other scripting

ASP & HTML

Dynamic pages can becreated.

Only static pages canbe created.

Can access anyDatabase.

Cannot access anyDatabase.

Scripts cannot beviewed from thebrowser.

Scripts can be viewedfrom the browser.

Support server-sidescripts to be written inASP pages.

Does not supportserver-side scripts to bewritten in HTML pages.

Scripts denoted bydelimiters: <% %>

Scripts denoted bydelimiters: < >

ASPHTML

Page 6: Active Server Pages (ASP.NET)€¦ · server-side scripts, along with HTML, XML or other text. ASP page has an extension .asp •Default scripting language is VBScript. Other scripting

What is .NET?• Microsoft’s platform for web services and web

applications.

• Basically, it is a layer between the OS and theprogramming language.

• The .NET platform currently supports around 24programming languages including VB.NET, C#,J#, C++, Perl etc.

• Provides large set of class libraries that can beaccessed from the different programminglanguages.

Page 7: Active Server Pages (ASP.NET)€¦ · server-side scripts, along with HTML, XML or other text. ASP page has an extension .asp •Default scripting language is VBScript. Other scripting

ASP.NET• Microsoft product used to develop dynamic

websites, web applications and web services.

• Previously named as ASP+, successor to ASP.

• First release: January 2002 (.NET framework 1.0)

• Latest release: August 2008 (.NET framework 3.5)

• Microsoft .NET framework constitutes of codelibraries that enable software and websitesdeveloped in the .NET environment to runsmoothly.

• ASP.NET also runs in the Internet InformationServices/Server (IIS) web server developed byMicrosoft.

Page 8: Active Server Pages (ASP.NET)€¦ · server-side scripts, along with HTML, XML or other text. ASP page has an extension .asp •Default scripting language is VBScript. Other scripting

Differences betweenASP (classic) & ASP.NET

Completely Object Oriented.Has limited Object Oriented support.

Has code-behind development modelto separate business logic frompresentation.

Has mixed HTML and coding logic.

Compiled language, i.e. code iscompiled to assemblies and loaded atrun time.

Interpreted language, i.e. code isinterpreted when the page is executed.

Uses more advanced and powerfullanguages such as C#, VB.NET, J# etc.

Uses less advanced script languagessuch as VB script, Jscript, PerlScript forcoding.

Quite an advanced exception handlingsystem. (try-catch blocks)

Poor exception handling system.

Has complete session and applicationstate management.

Has limited session and applicationstate management.

No such protection available.Has memory leak, deadlock and crashprotection.

Supported by a variety of powerfulcompilers and tools, e.g. Visual Studio.NET.

Supported by very few developmentand debugging tools.

ASP.NETASP Classic

Page 9: Active Server Pages (ASP.NET)€¦ · server-side scripts, along with HTML, XML or other text. ASP page has an extension .asp •Default scripting language is VBScript. Other scripting

Why ASP.NET?• It drastically reduces the amount of code required to

build large applications.

• The source code is executed on the web server which

provides lots of power and flexibility to the UI pages.

• The source code is compiled the first time the page is

requested. The server saves the compiled version of the

page for use next time the page is requested which

speeds up the accessing of pages.

•The HTML (and not the application source code)

produced by the ASP.NET page is sent back to the

browser which ultimately enhances security.

• Has lots of built-in validation and security controls.

• ASP.NET applications run faster and counters large

volumes of users without performance problems.

Page 10: Active Server Pages (ASP.NET)€¦ · server-side scripts, along with HTML, XML or other text. ASP page has an extension .asp •Default scripting language is VBScript. Other scripting

ASP.NET Architecture

• Web clients communicate with ASP.NET application

through IIS.

• IIS authenticates the request.

• If authentication is not set, no authentication occurs.

• IIS retrieves the requested resource (file).

• If the web client is authorized, IIS returns the requested

resource.

Page 11: Active Server Pages (ASP.NET)€¦ · server-side scripts, along with HTML, XML or other text. ASP page has an extension .asp •Default scripting language is VBScript. Other scripting

Dynamic Page Creation by ASP.NET

• Tradional way

• Client requests for the web page.

Web server sends the (same) web page to theclient.

In essense, static pages are sent to the client.

Page 12: Active Server Pages (ASP.NET)€¦ · server-side scripts, along with HTML, XML or other text. ASP page has an extension .asp •Default scripting language is VBScript. Other scripting

• ASP.NET way

• Client requests for the web page.

Web server sends request to the ASP.NET engine.

A new webpage is created.

ASP.NET engine sends the created webpage to theclient.

In essense, dynamic pages are sent to the client.

Dynamic Page Creation by ASP.NET

Page 13: Active Server Pages (ASP.NET)€¦ · server-side scripts, along with HTML, XML or other text. ASP page has an extension .asp •Default scripting language is VBScript. Other scripting

An Example

<% @Page Language="C#" Debug="true" %>

<script runat="server">

void Page_Load(object sender, EventArgs e)

{

int hour = DateTime.Now.Hour;

if( hour <= 11)

{

Response.Write("Good Morning.");

}

else if( hour <= 18)

{

Response.Write("Good Afternoon.");

}

else if( hour <= 20)

{

Response.Write("Good Evening.");

}

else

{

Response.Write("Good Night.");

}

Response.Write("<br>"+DateTime.Now.ToString());

}

</script>

Dynamic Page Creation by ASP.NET

Page 14: Active Server Pages (ASP.NET)€¦ · server-side scripts, along with HTML, XML or other text. ASP page has an extension .asp •Default scripting language is VBScript. Other scripting

Who is using ASP.NET today?

Page 15: Active Server Pages (ASP.NET)€¦ · server-side scripts, along with HTML, XML or other text. ASP page has an extension .asp •Default scripting language is VBScript. Other scripting

Thank You!

reference: www.msdn.com