180 likes | 256 Views
Session 2. ASP.NET Objects. Session Objectives. Explain the Basics of ASP.NET. Discuss the Process Flow of an ASP.NET Page. Explain the Page_Load Event. Discuss the IsPostBack Property of the Page object. Use the Request and Response Objects. An ASP.NET Page– 1. @Page Directive.
E N D
Session 2 ASP.NET Objects Building Applications using ASP.NET and C# / Session 2 / 1 of 18
Session Objectives • Explain the Basics of ASP.NET • Discuss the Process Flow of an ASP.NET Page • Explain the Page_Load Event • Discuss the IsPostBack Property of the Page object • Use the Request and Response Objects Building Applications using ASP.NET and C# / Session 2 / 2 of 18
An ASP.NET Page– 1 @Page Directive <SCRIPT> Page_Load Event Handler Building Applications using ASP.NET and C# / Session 2 / 3 of 18
An ASP.NET Page– 2 HTML Control Web Control Building Applications using ASP.NET and C# / Session 2 / 4 of 18
Starting with ASP.NET @ Page Directive <%@ Page Language=”C#” %> <SCRIPT> Section <script language = "C#" runat="server"> </script> ... code ... Building Applications using ASP.NET and C# / Session 2 / 5 of 18
User Interface HTML Controls <input type="button" id="Submit" runat="server" value="Click"/> Web Controls <asp:button id=”Submit” onclick="click_button" text="Click me" runat="server"/> Building Applications using ASP.NET and C# / Session 2 / 6 of 18
.aspx page .aspx page Hello World LABEL Click Me Click Me Event Handlers void click_btn(Object sender, EventArgs e) {lbl.Text= "Hello World";} Building Applications using ASP.NET and C# / Session 2 / 7 of 18
Name E- mail Password Name King Submit Submit E- mail K@usa.net Password ****** _VIEWSTATE Before Changes After Changes Building Applications using ASP.NET and C# / Session 2 / 8 of 18
Retrieve Data .aspx page Database Page_Load Event Hello World Set properties .IsPostBack Building Applications using ASP.NET and C# / Session 2 / 9 of 18
Process Flow HTTP Request Execution on the server 2 1 HTML Page 6 Changes are processed 3 HTML Page 5 7 Values after Postback User causes Postback 4 Building Applications using ASP.NET and C# / Session 2 / 10 of 18
ASP.NET Objects -1 Building Applications using ASP.NET and C# / Session 2 / 11 of 18
ASP.NET Objects –2 Building Applications using ASP.NET and C# / Session 2 / 12 of 18
ASP.NET Objects – 3 Building Applications using ASP.NET and C# / Session 2 / 13 of 18
Virtual Directories Building Applications using ASP.NET and C# / Session 2 / 14 of 18
Permissions Read Script Permissions Execute Write Building Applications using ASP.NET and C# / Session 2 / 15 of 18
HTTP Protocol Header HTTP Request HTTP Response Message Body Building Applications using ASP.NET and C# / Session 2 / 16 of 18
Request & Response Building Applications using ASP.NET and C# / Session 2 / 17 of 18
Response.Redirect Building Applications using ASP.NET and C# / Session 2 / 18 of 18