Chapter 3 Slides Asp
Chapter 3 Slides Asp
Chapter 3 Slides Asp
Slide 1
Objectives
Applied Given the specifications for a multi-page web application that uses an Access data source to get data, design, code, and test the application. To transfer to another page within a web application, be able to use the Transfer method, the Redirect method, or cross-page posting. To refer to pages or other files within an application, be able to use either absolute or relative URLs. Knowledge Describe the contents of these special folders for ASP.NET applications: App_Code and App_Data. Describe two ways that you can use an existing class with a new web application.
Slide 2
Objectives (continued)
In general terms, describe the procedure for renaming a web form file as well as the class that contains the code for the web form. Distinguish between the Transfer method of the HttpServerUtility class, the Redirect method of the HttpResponse class, and cross-page posting. Distinguish between absolute and relative URLs. Describe an Access data source. In general terms, explain how the AccessDataSource, DataView, and DataRowView classes can be used to get data from a data source. Describe how session state objects, session IDs, and cookies are used to track the state of each user of a web application.
Slide 3
Slide 4
Slide 5
Slide 6
Slide 7
Slide 8
Slide 9
Slide 10
Slide 11
Slide 12
Slide 13
Slide 14
Slide 15
Statements that use relative URLs that are based on the current directory
Response.Redirect("Checkout.aspx") Response.Redirect("Login/Register.aspx")
Slide 16
Statements that use relative URLs that navigate up the directory structure
Response.Redirect("../Register.aspx") Response.Redirect("../../Register.aspx") Response.Redirect("/Register.aspx") Response.Redirect("/Login/Register.aspx")
Slide 17
Server control attributes that use URLs that are based on the root directory of the current web site
PostBackUrl="~/Cart.aspx" ImageUrl="~/Images/banner.jpg"
Slide 18
Slide 19
Slide 20
Slide 21
Slide 22
Slide 23
Objects used
DataView DataRowView
Slide 24
Server
Web server
First HTTP response: The server returns the requested page along with the session ID.
Browser
Session ID Next HTTP request: The browser requests another page. The server uses the session ID included in the request to associate the browser with the correct session state object.
Web server
Browser
Session ID
Web server
Slide 25
Slide 26
Slide 27
Slide 28
Slide 29
Retrieving the value of a session state item from a class that doesnt inherit System.Web.UI.Page
SortedList cart = (SortedList) HttpContext.Current.Session["Cart"];
Slide 30
/// <summary> /// Summary description for Product /// </summary> public class Product{ public string ProductID; public string Name; public string ShortDescription; public string LongDescription; public decimal UnitPrice; public string ImageFile; }
Murachs ASP.NET 3.5/C#, C3 2008, Mike Murach & Associates, Inc. Slide 31
Slide 32
Slide 33
Slide 34
Slide 35
Slide 36
Slide 37
Slide 38
Slide 39
Slide 40
Slide 41
Slide 42
Slide 43
Slide 44
Slide 45
Slide 46
Slide 47
Slide 48
Slide 49
Slide 50
Slide 51
Slide 52