Asp.net slide
Trang 1Session 1
ASP.NET and Web Forms
Trang 2 Explore Active Server Pages
State the Drawbacks and advantages of ASP
Explain the features of ASP.NET
Explain the Features of Web Forms
State the differences between pages
created in Web Forms and Editors
Trang 3Active Server Pages
<HTML><BODY>
<CENTER><I><FONT COLOR="HOTPINK" size = 5>
<%If Time >= #12:00:00 AM# And Time < #12:00:00 PM#
Then%>
"Now the time is between 12:00 am and 12:00 pm"
<%Else%>
" Now the time is between 12:00 pm and 12:00 am"
<%End If%>
</FONT></I></CENTER>
</BODY></HTML> Executed on server
Trang 4Processing of ASP file
Client
(Browser)
ASP.DLL
JavaScript
ActiveX Data
Objects (ADO)
ActiveX Data
Objects (ADO) Database ASP file
Trang 5Advantages of ASP
Trang 6ASP file in a Web-based
application
Client
(Browser)
Active
Server
Components
Active
Server
Components
Database
Active Server Pages (ASP)
•JavaScript
•VBScript
Active Server Pages (ASP)
•JavaScript
•VBScript
Active Server Pages (ASP)
•JavaScript
•VBScript
Active Server Pages (ASP)
•JavaScript
•VBScript
Active Server Pages (ASP)
•JavaScript
•VBScript
Active Server Pages (ASP)
•JavaScript
•VBScript
Trang 7Evolution of ASP.NET
Trang 8Drawbacks of ASP
Interpreted ASP pages Only two non-typed languages VBScript and JavaScript
Spaghetti-like mixture of code, HTML and text
Using the same file
Extra code for functionality
No code Re-use
No debugging mechanism Shut down of web server to install a new version of a DLL
Trang 9Advantages of ASP.NET
ASP.NET
Supports strongly typed languages like C#, VB
Compiled pages improve
execution speed
Compiled pages improve
execution speed
Supports re-use of code by the mechanism of inheritance
Supports re-use of code by the mechanism of inheritance
ASP code is separated from
the HTML design and text
ASP code is separated from
the HTML design and text
Provides server controls that
are declarative
Provides server controls that
are declarative
An inbuilt method Trace,
helps in debugging a page
An inbuilt method Trace,
helps in debugging a page
No need to register component
No need to register component
Trang 10Features of ASP.NET
ASP.NET
Recognizes the type of client browser, and accordingly displays the contents to the client
Recognizes the type of client browser, and accordingly displays the contents to the client
Adds functionality using C# or VB.NET
Uses server - side caching
Ships with many built-in server controls
Trang 11Features of ASP.NET Contd…
Refers hierarchical namespaces
Global.asax file holds additional events
Web service - a function deployed and used over the web
ASP.NET
Trang 12Web Form IDE
Trang 13WebForms Toolbox
Trang 14WebForms Toolbox Contd…
Trang 15Project files - Web Forms
Trang 16Differences between pages
created in Web Forms and Editors
Most of the features supported by Web Forms can be
achieved with the help of ASP.NET programs, written
using editors
The different web pages of an application created using Web Forms, and the program code within it, are compiled into a single assembly / dynamic link library (.dll) file
In the editor based web application, separate dynamic
link libraries (.dlls) are created for each file
The web pages created using Web Forms will have the Codebehind attribute
Trang 17that provides a web server with the capability to process application logic, and return standard HTML pages to the browser
tools, which can be used to rapidly build server-based,
programmable user interfaces for browsers and Web client devices
would be displayed in the browser
to create the Web page
project It contains information such as name, version, and culture information
to native code when the request for the web page is encountered, providing improved performance
Trang 18Summary Contd…
information about each URL used in the project
application-level events
complied to Intermediate Language (IL), including server scripts
and the program code within it, are compiled into a single
assembly / dynamic link library (.dll) file
(.dll's) are created for each file
attribute, that informs Web Forms IDE about the code file that has
to be changed, whenever a change is made to the Design, or the
HTML view of the Web Form