1 / 47

Objectives

1. Objectives. Define the terms used when talking about the Web Create a Web application Add controls to a Web form Start a Web application Use the validator controls. Objectives ( continued ). Include a list box on a Web form Determine whether a postback has occurred

feivel
Download Presentation

Objectives

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 1

  2. Objectives • Define the terms used when talking about the Web • Create a Web application • Add controls to a Web form • Start a Web application • Use the validator controls Microsoft Visual Basic .NET: Reloaded

  3. Objectives (continued) • Include a list box on a Web form • Determine whether a postback has occurred • Include a DataGrid control on a Web form Microsoft Visual Basic .NET: Reloaded

  4. Web Terminology • Internet – world’s largest computer network • WWW (World Wide Web) • Contains documents called web pages • Web pages are stored on Web Servers • Web Server is a computer with software to serve up web pages in response to client requests (web browser) Microsoft Visual Basic .NET: Reloaded

  5. Web Terminology (continued) • Static Web page displays information to the viewer Microsoft Visual Basic .NET: Reloaded

  6. Web Terminology (continued) • HTML (Hypertext Markup Language) tags tell browser how to display information in page Microsoft Visual Basic .NET: Reloaded

  7. Web Terminology (continued) • URL (Uniform Resource Locater) • Unique address that identifies location of a web page • URL contains 4 parts: • http:// -- HTTP communication protocol • Protocol is agreement between sender and receiver how data is sent and interpreted • Host -- name of web server • Path -- location of document on the web server • Document name Microsoft Visual Basic .NET: Reloaded

  8. Web Terminology (continued) • Dynamic Web page is interactive • It can accept information from the user and also retrieve information for the user Microsoft Visual Basic .NET: Reloaded

  9. Web Terminology (continued) • Use Web Form Designer Window to create web pages in Visual Basic .NET Microsoft Visual Basic .NET: Reloaded

  10. Web Terminology (continued) • Use HTML tab to view html code automatically generated by the IDE Microsoft Visual Basic .NET: Reloaded

  11. Web Terminology (continued) • .aspx file contains controls and html • .aspx.vb file contains program code Microsoft Visual Basic .NET: Reloaded

  12. HOW TO… Microsoft Visual Basic .NET: Reloaded

  13. Creating Web Applications • Begin by starting a blank solution Microsoft Visual Basic .NET: Reloaded

  14. Creating Web Applications (continued) • Add a ASP.NET Web Application project to the blank solution Microsoft Visual Basic .NET: Reloaded

  15. Creating Web Applications (continued) • IDE with web form in design view Microsoft Visual Basic .NET: Reloaded

  16. Creating Web Applications (continued) • Rename web pate (.aspx file) and set title property Microsoft Visual Basic .NET: Reloaded

  17. Adding Controls to a Web Form • Similar to adding controls to a Windows form • Use tools contained in toolbox • Controls are not identical to Windows counterparts • Have ID property rather than name property Microsoft Visual Basic .NET: Reloaded

  18. HOW TO… Microsoft Visual Basic .NET: Reloaded

  19. Adding Controls to a Web Form (continued) Microsoft Visual Basic .NET: Reloaded

  20. Adding Controls to a Web Form (continued) Microsoft Visual Basic .NET: Reloaded

  21. HOW TO… Microsoft Visual Basic .NET: Reloaded

  22. Starting a Web Application • Displays in external browser or in internal browser built into Visual Studio .NET Microsoft Visual Basic .NET: Reloaded

  23. HOW TO… Microsoft Visual Basic .NET: Reloaded

  24. Using the Web Validator Tools • RequiredField validator – verifies control contains data • RangeValidator – verifies data falls within a set range of values Microsoft Visual Basic .NET: Reloaded

  25. HOW TO… Microsoft Visual Basic .NET: Reloaded

  26. Including a List Box on a Web Form Microsoft Visual Basic .NET: Reloaded

  27. Code for Stovall application Microsoft Visual Basic .NET: Reloaded

  28. Code for Stovall application(continued) Microsoft Visual Basic .NET: Reloaded

  29. Stovall application (continued) • Page_Load event • Occurs first time web form is displayed • Also occurs when a postback action happens • Postback refers to client requesting data from server • IsPostBack property indicates if form is being displayed for first time or as a result of postback Microsoft Visual Basic .NET: Reloaded

  30. Stovall application (continued) • Sample run of Stovall Application Microsoft Visual Basic .NET: Reloaded

  31. Including a DataGrid Control on a Web Form Microsoft Visual Basic .NET: Reloaded

  32. Including a DataGrid Control on a Web Form (continued) • Web application for Fairview Industries connects to an Access database and displays data in datagrid Microsoft Visual Basic .NET: Reloaded

  33. Including a DataGrid Control on a Web Form(continued) • Must call DataBind method to bind data to datagrid Microsoft Visual Basic .NET: Reloaded

  34. Customizing the Appearance of the Web DataGrid Control’s Data • Click datagrid control and then click Auto Format link in properties list Microsoft Visual Basic .NET: Reloaded

  35. Customizing the Appearance of the Web DataGrid Control’s Data (continued) • Sample run of Fairview application with Datagrid formatted using Professional 2 scheme Microsoft Visual Basic .NET: Reloaded

  36. Programming Example – Monthly Payment Calculator Application • Fred Pierce has been shopping for a new car and has asked you to create an application that he can use to calculate and display his monthly car payment, • using annual interest rates of 5%, 6%, 7%, 8%, 9%, and 10%, and • terms of two, three, four, and five years Microsoft Visual Basic .NET: Reloaded

  37. TOE Chart Microsoft Visual Basic .NET: Reloaded

  38. User Interface Microsoft Visual Basic .NET: Reloaded

  39. Objects, Properties, and Settings Microsoft Visual Basic .NET: Reloaded

  40. Objects, Properties, and Settings(continued) Microsoft Visual Basic .NET: Reloaded

  41. Pseudocode Page Load event procedure 1. if it’s the first time the Web form is displayed fill the lstRate control with data fill the lstTerm control with data select the first item in each list box end if btnCalc Click event procedure 1. calculate the monthly payment 2. display the monthly payment in lblPayment Microsoft Visual Basic .NET: Reloaded

  42. Code Microsoft Visual Basic .NET: Reloaded

  43. Code (continued) Microsoft Visual Basic .NET: Reloaded

  44. Summary • The Web consists of Web pages that are stored on Web servers • A client uses a browser to request a Web page from a Web server • Web pages can be either static or dynamic (interactive) • Static Web pages contain the information to display, as well as the HTML tags that control the appearance of the information • Static Web pages are not interactive Microsoft Visual Basic .NET: Reloaded

  45. Summary (continued) • Every Web page has a unique address, called a URL, that indicates its location on the Web • A URL consists of four parts: the protocol, the name of the Web server, the path to the Web page, and the name of the Web page • A Web server can be a remote computer or your local machine • To make your local machine a Web server, you must install and configure Microsoft IIS (Internet Information Services) Microsoft Visual Basic .NET: Reloaded

  46. Summary (continued) • A dynamic Web page requires two files: one ending with .aspx and the other with .aspx.vb • The .aspx file contains the controls and HTML that define the Web page’s interface, and the .aspx.vb file contains program code • You add controls to a Web form in the same way that you add controls to a Windows form • The Web Forms tab in toolbox contains Web tools • Web tools are similar but not identical to their Windows counterparts Microsoft Visual Basic .NET: Reloaded

  47. Summary (continued) • You test a Web application using a browser • The Web Forms tab on the toolbox contains five validator tools • Validator tools allow you to validate user input • You can use a Web form’s IsPostBack method to determine whether the form is being displayed for the first time Microsoft Visual Basic .NET: Reloaded

More Related