introduction of asp

Upload: ramjaneranchon

Post on 07-Apr-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 Introduction of ASP

    1/38

    Introduction of ASP.NET

    ByMr. V. Ram S.

    6/11/2011 1IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    2/38

    Wha t You S h ould Alre a dy Know!

    Before you continue you should have a basicunderstanding of the following:WWW, HTML, XML and the basics of building WebpagesScripting languages like JavaScript or VBScriptThe basics of server side scripting like ASP or PHP

    6/11/2011 2IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    3/38

    Wha t is Cl a ssic ASP?

    Microsoft's previous server side scriptingtechnology ASP (Active Server Pages) is nowoften called classic ASP.ASP 3.0 was the last version of classic ASP.

    6/11/2011 3IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    4/38

    ASP.NET is NOT ASP

    ASP.NET is the next generation ASP, but it's not anupgraded version of ASP.ASP.NET is an entirely new technology for server-side scripting. It was written from the ground upand is not backward compatible with classic ASP.You can read more about the differencesbetween ASP and ASP.NET in the next chapter of this tutorial.ASP.NET is the major part of the Microsoft's .NETFramework.

    6/11/2011 4IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    5/38

    Wha t is ASP.NET?

    ASP.NET is a server side scripting technology thatenables scripts (embedded in web pages) to beexecuted by an Internet server.

    ASP.NET is a Microsoft TechnologyASP stands for Active Server PagesASP.NET is a program that runs inside IISIIS (Internet Information Services) is Microsoft's

    Internet serverIIS comes as a free component with Windows serversIIS is also a part of Windows 2000 and XP Professional

    6/11/2011 5IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    6/38

    Wha t is a n ASP.NET File?

    An ASP.NET file is just the same as an HTMLfile

    An ASP.NET file can contain HTML, XML, andscriptsScripts in an ASP.NET file are executed on theserverAn ASP.NET file has the file extension ".aspx"

    6/11/2011 6IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    7/38

    H ow Does ASP.NET W ork?

    When a browser requests an HTML file, theserver returns the fileWhen a browser requests an ASP.NET file, IISpasses the request to the ASP.NET engine onthe serverThe ASP.NET engine reads the file, line by line,

    and executes the scripts in the fileFinally, the ASP.NET file is returned to thebrowser as plain HTML

    6/11/2011 7IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    8/38

    Wha t is ASP+?

    ASP+ is the same as ASP.NET.ASP+ is just an early name used by Microsoft

    when they developed ASP.NET.

    6/11/2011 8IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    9/38

    Th e Microsoft .NET Fr am ework

    The .NET Framework is the infrastructure for theMicrosoft .NET platform.The .NET Framework is an environment for building,deploying, and running Web applications and WebServices.Microsoft's first server technology ASP (Active ServerPages), was a powerful and flexible "programminglanguage". But it was too code oriented. It was not anapplication framework and not an enterprisedevelopment tool.The Microsoft .NET Framework was developed to solvethis problem.

    6/11/2011 9IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    10/38

    NET Fr am eworks keywords:

    Easier and quicker programmingReduced amount of code

    Declarative programming modelRicher server control hierarchy with eventsLarger class library

    Better support for development tools

    6/11/2011 10IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    11/38

    Th e .NET Fr am ework consists of 3 ma in p a rts:

    Programming languages:C# (Pronounced C sharp)Visual Basic (VB .NET)J# (Pronounced J sharp)

    Server technologies and client technologies:ASP .NET (Active Server Pages)Windows Forms (Windows desktop solutions)Compact Framework (PDA / Mobile solutions)Development environments:

    Visual Studio .NET (VS .NET)Visual Web Developer

    This tutorial is about ASP.NET.

    6/11/2011 11IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    12/38

    ASP.NET 2.0

    ASP.NET 2.0 improves upon ASP.NET by addingsupport for several new features.

    6/11/2011 12IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    13/38

    ASP.NET 3.0

    ASP.NET 3.0 is not a new version of ASP.NET.It's just the name for a new ASP.NET 2.0framework library with support for WindowsPresentation Foundation, WindowsCommunication Foundation, WindowsWorkflow Foundation; and Windows

    Card Space.

    6/11/2011 13IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    14/38

    New in ASP.NET

    Better language supportProgrammable controlsEvent-driven programming

    XML-based componentsUser authentication, with accounts and rolesHigher scalabilityIncreased performance - Compiled codeEasier configuration and deploymentNot fully ASP compatible

    6/11/2011 14IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    15/38

    L a ngu a ge Support

    ASP.NET uses ADO.NET.ASP.NET supports full Visual Basic, not

    VBScript.ASP.NET supports C# (C sharp) and C++.ASP.NET supports JScript.

    6/11/2011 15IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    16/38

    ASP.NET Controls

    ASP.NET contains a large set of HTML controls.Almost all HTML elements on a page can bedefined as ASP.NET control objects that can be

    controlled by scripts.ASP.NET also contains a new set of object-oriented input controls, like programmable list-boxes and validation controls.

    A new data grid control supports sorting, datapaging, and everything you can expect from adataset control.

    6/11/2011 16IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    17/38

    Event Aw a re Controls

    All ASP.NET objects on a Web page can exposeevents that can be processed by ASP.NETcode.Load, Click and Change events handled bycode makes coding much simpler and muchbetter organized.

    6/11/2011 17IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    18/38

    ASP.NET Co m ponents

    ASP.NET components are heavily based onXML. Like the new AD Rotator, that uses XMLto store advertisement information andconfiguration.

    6/11/2011 18IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    19/38

    U ser Aut h entic a tion

    ASP.NET supports form-based userauthentication, cookie management, andautomatic redirecting of unauthorized logins.

    6/11/2011 19IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    20/38

    U ser Accounts a nd Roles

    ASP.NET allows user accounts and roles, togive each user (with a given role) access todifferent server code and executables.

    6/11/2011 20IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    21/38

    H igh Sc a lab ility

    Much has been done with ASP.NET to providegreater scalability.Server-to-server communication has beengreatly enhanced, making it possible to scalean application over several servers. Oneexample of this is the ability to run XMLparsers, XSL transformations and evenresource hungry session objects on otherservers.

    6/11/2011 21IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    22/38

    Co m piled Code

    The first request for an ASP.NET page on theserver will compile the ASP.NET code and keepa cached copy in memory. The result of this isgreatly increased performance.

    6/11/2011 22IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    23/38

    Ea sy Configur a tion

    Configuration of ASP.NET is done with plaintext files.

    Configuration files can be uploaded orchanged while the application is running. Noneed to restart the server. No more metabaseor registry puzzle.

    6/11/2011 23IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    24/38

    Ea sy Deploy m ent

    No more server-restart to deploy or replacecompiled code. ASP.NET simply redirects allnew requests to the new code.

    6/11/2011 24IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    25/38

    Co m pa tib ility

    ASP.NET is not fully compatible with earlierversions of ASP, so most of the old ASP codewill need some changes to run under ASP.NET.To overcome this problem, ASP.NET uses anew file extension ".aspx". This will makeASP.NET applications able to run side by sidewith standard ASP applications on the sameserver.

    6/11/2011 25IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    26/38

  • 8/6/2019 Introduction of ASP

    27/38

  • 8/6/2019 Introduction of ASP

    28/38

    Service P a cks a nd U pd a tes

    Before ASP.NET can be installed on yourcomputer, all relevant service packs and securityupdates must be installed.

    The easiest way to do this is to activate yourWindows Internet Update. When you access theWindows Update page, you will be instructed toinstall the latest service packs and all critical

    security updates. For Windows 2000, make sureyou install Service Pack 2. You should also installthe latest version of Internet Explorer.

    6/11/2011 28IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    29/38

    Inst a ll .NET

    From your Windows Update you can nowselect the Microsoft .NET Framework.

    After download, the .NET framework willinstall itself on your computer - there are nooptions to select for installation.

    6/11/2011 29IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    30/38

    H ow Does it W ork?

    Fundamentally an ASP.NET page is just the same as an HTML page.

    An HTML page has the extension .htm. If a browser requests anHTML page from the server, the server sends the page to thebrowser without any modifications.

    An ASP.NET page has the extension .aspx. If a browser requests anASP.NET page, the server processes any executable code in thepage, before the result is sent back to the browser.

    The ASP.NET page above does not contain any executable code, sonothing is executed. In the next examples we will add someexecutable code to the page to demonstrate the differencebetween static HTML pages and dynamic ASP pages.

    6/11/2011 30IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    31/38

    Cla ssic ASP

    placed inside HTML pages.Previous versions of ASP (before ASP .NET) are

    often called Classic ASP.ASP.NET is not fully compatible with ClassicASP, but most Classic ASP pages will work fineas ASP.NET pages, with only minor changes.

    6/11/2011 31IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    32/38

    Dyn am ic P a ge in Cl a ssic ASP

    To demonstrate how ASP can display pages with dynamic content,we have added some executable code (in red) to the previousexample:Hello W3Schools!

    The code inside the tags is executed on the server.Response.Write is ASP code for writing something to the HTMLoutput stream.Now() is a function returning the servers current date and time.

    6/11/2011 32IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    33/38

    Dyn am ic P a ge in ASP .NET

    Hello W3Schools!

    6/11/2011 33IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    34/38

    L im ita tions in Cl a ssic ASP

    Hello W3Schools!

    The code above illustrates a limitation in Classic ASP: Thecode block has to be placed where you want the output toappear.With Classic ASP it is impossible to separate executablecode from the HTML itself. This makes the page difficult toread, and difficult to maintain.

    6/11/2011 34IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    35/38

    Adv a nt a ge of ASP.NET

    ASP.NET has many advantages over other platforms when it comes tocreating Web applications. Probably the most significant advantage is itsintegration with the Windows server and programming tools. Webapplications created with ASP.NET are easier to create, debug, and deploybecause those tasks can all be performed within a single developmentenvironment Visual Studio .NET.ASP.NET delivers the following other advantages to Web applicationdevelopers:Executable portions of a Web application compiled so they execute morequickly than interpreted scriptsOn-the-fly updates of deployed Web applications without restarting theserverAccess to the .NET Framework, which extends the Windows APIUse of the widely known Visual Basic programming language, which hasbeen enhanced to fully support object-oriented programming

    6/11/2011 35IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    36/38

    Adv a nt a ge of ASP.NETIntroduction of the new Visual C# programming language, which providesa type-safe, object-oriented version of the C programming languageAutomatic state management for controls on a Web page (called servercontrols) so that they behave much more like Windows controlsThe ability to create new, customized server controls from existing controls

    Built-in security through the Windows server or through otherauthentication/authorization methodsIntegration with Microsoft ADO.NET to provide database access anddatabase design tools from within Visual Studio .NETFull support for Extensible Markup Language (XML), cascading style sheets(CSS), and other new and established Web standards

    Built-in features for caching frequently requested Web pages on theserver, localizing content for specific languages and cultures, and detectingbrowser capabilities

    6/11/2011 36IT-POINT, Kanpur(U.P.)

  • 8/6/2019 Introduction of ASP

    37/38

  • 8/6/2019 Introduction of ASP

    38/38