ASP'NET - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

ASP'NET

Description:

In 'classic' ASP, VBscript was the default language for developing ASP pages ... VBscript is not part of the framework. ASP.NET applications are written in a ... – PowerPoint PPT presentation

Number of Views:15
Avg rating:3.0/5.0
Slides: 17
Provided by: harold8
Category:
Tags: asp | net

less

Transcript and Presenter's Notes

Title: ASP'NET


1
ASP.NET
  • Another brief Overview

2
ASP.NET
  • Increasingly the Web and the browser interface is
    driven by the need to support applications.
  • ASP.NET is not a CLR-based language.
  • ASP.NET is part of the class library
  • In classic ASP, VBscript was the default
    language for developing ASP pages (part of the
    reason so much VB is out there....
  • VBscript is not part of the framework.
  • ASP.NET applications are written in a CLR-based
    language (e.g., VB or c)

3
(No Transcript)
4
code-behind
Index.aspx.vb
Index.aspx
Compiled Into MSIL
IIS
Browser
Index.aspx
http
Web Controls
ADO.NET
txtLogin
authenticate user
txtPwd
User.cs
cmdLogin
dbms
Common Language Runtime
5
aspx pages
  • ASP.Net is not a scripted environment like
    classic ASP. All pages are compiled into classes
    that run on the CLR.
  • The output of an aspx is HTML which is sent to
    the requesting browser via the web server.

6
aspx pages
  • In classic ASP, each page is processed
    sequentially and interpreted rather than
    compiled.
  • There was really only one event in this model
    page was requested.
  • ASP.Net is a fully event-driven environment.

7
aspx pages
  • In classic ASP vs ASP.Net
  • In class demo with SQL Injection example

8
aspx pages
  • When a page is requested by a browser, there is a
    page_load event.
  • When all processing is done, there is a
    page_unload event.
  • A developer can define a click event for every
    web control on the web form.
  • Life cycle of an ASPX page
  • http//msdn2.microsoft.com/en-us/library/ms178472.
    aspx

9
Web Controls
  • Web controls are an alternative to HTML controls.
  • An aspx page can have both

10
Web Controls
HTML Controls
You can tell if it is a web or HTML control
because web controls have a little green arrow in
the corner.
11
Code-behind
  • Mixing markup tags and presentation logic syntax
    makes a page very difficult to read and maintain.
  • Code-behind separates the markup tags from code
    in a separate file.
  • The aspx and aspx.vb files are linked by a
    reference.

12
The two files are linked
13
Code-behind
  • The code in a code-behind page could be written
    inline with script blocks
  • ltscript runatservergtlt/scriptgt
  • Or render blocks
  • lt gt
  • For example, in main.aspx I use a render block to
    print the content of the treeview.

14
I use the Write method of the Response object to
print the contents of the variable I populated in
the code-behind page in the page_load event.
15
This treeview is generated dynamically from the
database and then rendered by Response.Write
method.
16
Code-behind
  • Although you can still write code directly in the
    aspx page, code-behind means
  • Clean separation of HTML and code
  • Easier Reuse
  • Simpler Maintenance
  • Deployment without source code
Write a Comment
User Comments (0)
About PowerShow.com