Download presentation
Presentation is loading. Please wait.
Published byAustin Crawford Modified over 9 years ago
1
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University of the West Indies Session 5 – The Microsoft.NET Framework – Part II Summer 2008
2
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott Objectives In this session the student will: Describe the ASP.NET framework Install ASP.NET Create an ASP.NET application
3
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott Motivation (Platt 2003) In the early days of the web, servers delivered static web pages Written using HTML and CSS Static pages do not work, however when users want to make ad hoc queries to a system
4
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott Motivation cont’d A dynamic system requires: Program logic associated with page requests User input, system output User identification User session management
5
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott What is ASP.NET? “ASP.NET is a sever-side framework for developing Web applications based on the Microsoft.NET Framework.” (Yank 2002)
6
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott What is ASP.NET cont’d? ASP.NET provides: State management Save to server or database Security Through Microsoft Passports or prefabricated authentication schemes Abstraction away from HTML Through Web forms and ASP.NET sever controls (web forms treated like desktop applications)
7
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott What is ASP.NET cont’d? ASP.NET has all of the benefits of the.NET framework For example it supports multiple languages The program logic and HTML output are separated in ASP.NET, making it easier to program and maintain
8
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott Popularity of ASP.NET Several web sites have been created using ASP.NET including: www.Match.com
9
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott Activity Install ASP.NET and the Microsoft Internet Information Service (IIS) Use the following resources to help you: http://www.sitepoint.com/print/asp-dot-net- introduction http://www.sitepoint.com/print/asp-dot-net- introduction http://www.sitepoint.com/print/getting-started-asp-net http://www.sitepoint.com/print/getting-started-asp-net
10
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott Activity cont’d Installing ASP.NET Open a command window and type: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50 727\ aspnet_regiis.exe -i
11
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott Activity cont’d Installing Microsoft Internet Information Services (IIS) Open the Control Panel Double mouse click on Add or Remove Programs On the right-hand side of the Add or Remove Program (that appears) click the Add/Remove Windows Component icon Scroll down the list of components that appear and select Internet Information Services (IIS) follow the installation instructions
12
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott Activity cont’d Configuring Microsoft IIS Open the control panel Double-click the Administrative Tools icon Double-click the Internet Information Services Icon. Select the Home Directory tab and set the location of the root directory to your website Change the port address to 8080 To test type http://localhost:8080/first.aspxhttp://localhost:8080/first.aspx Note the file first.aspx needs to be placed in the root directory of your website
13
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott Activity cont’d Use this program to test your installation My First ASP.NET Page protected void Page_Load(Object Source, EventArgs E) { TimeLabel.Text = DateTime.Now.ToString(); } The time is:
14
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott ASP.NET page anatomy ASP.NET pages are text files with an aspx extension When a browser requests an ASP.NET page, the ASP.NET runtime (as a component of the.NET Framework's Common Language Runtime, or CLR) parses and compiles the target file into a.NET Framework class. The application logic now contained within the new class is used in conjunction with the presentational HTML elements of the ASP.NET page to display dynamic content to the user. (Ruvalcaba 2004b)
15
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott ASP.NET page anatomy cont’d Some of the elements that make up an ASP.NET page include: Directives Code declaration blocks Code render blocks Server-side comments
16
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott Directives Directives control compilation, specify settings, allow debugging and importing of classes Page directive – specifies the language Import directive – imports classes/namespaces
17
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott Code declaration blocks Contains the application logic for the page External code pages may also be specified in the script tag: void method(){ // code }
18
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott Code declaration blocks cont’d Note script tags can also have a language and src attribute Specifies the language of the script Specifies an external file for the script …
19
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott Comments Comments are specified by // or /* … */ in C# To prevent items from being processed by ASP.NET use server-side comments
20
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott Code render blocks Used to define inline code and is executed when it is encountered There are two types Inline code Inline expressions
21
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott Activity Read the following chapter: http://sitepoint.com/print/vb-dot-net-c-sharp- programming http://sitepoint.com/print/vb-dot-net-c-sharp- programming
22
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott Activity Create a form that accepts the personal information of an individual and validate it using ASP.NET
23
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott Conclusion In this session The ASP.NET framework was described A simple ASP.NET application was developed
24
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott References Platt, D., “Introducing Microsoft.NET”, Third Edition, Microsoft Press, 2003 Ruvalcaba, Z., “Build Your Own ASP.NET Website Using C# And VB.NET, Chapter 1 – Introduction to.NET and ASP.NET”, 2004. Available online at http://www.sitepoint.com/print/asp-dot-net-introduction http://www.sitepoint.com/print/asp-dot-net-introduction Ruvalcaba, Z., “Build Your Own ASP.NET Website Using C# And VB.NET, Chapter 2 – ASP.NET Basics”, 2004. Available online at http://www.sitepoint.com/print/asp-dot-net- basicshttp://www.sitepoint.com/print/asp-dot-net- basics Yank, K., “Getting Started with ASP.NET”, 2002. Available online at http://www.sitepoint.com/print/getting-started-asp-net http://www.sitepoint.com/print/getting-started-asp-net
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.