session 2
DESCRIPTION
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. - PowerPoint PPT PresentationTRANSCRIPT
Building Applications using ASP.NET and C# / Session 2 / 2 of 18
Session Session ObjectivesObjectives
Explain the Basics of ASP.NET
Explain the Basics of ASP.NETDiscuss the Process Flow of an
ASP.NET Page Discuss the Process Flow of an ASP.NET Page Explain the Page_Load Event Explain the Page_Load Event Discuss the IsPostBack Property of the Page objectDiscuss the IsPostBack Property of the Page object Use the Request and Response
Objects Use the Request and Response
Objects
Building Applications using ASP.NET and C# / Session 2 / 3 of 18
@Page Directive
<SCRIPT>
Page_Load
Event Handler
An ASP.NET An ASP.NET Page– 1 Page– 1
Building Applications using ASP.NET and C# / Session 2 / 4 of 18
HTML Control
Web Control
An ASP.NET Page– 2 An ASP.NET Page– 2
Building Applications using ASP.NET and C# / Session 2 / 5 of 18
Starting with Starting with ASP.NET ASP.NET
<%@ Page Language=”C#” %> <%@ Page Language=”C#” %>
<script language = "C#" runat="server">
</script>
<script language = "C#" runat="server">
</script>
Building Applications using ASP.NET and C# / Session 2 / 6 of 18
<input type="button" id="Submit" runat="server" value="Click"/><input type="button" id="Submit" runat="server" value="Click"/>
<asp:button id=”Submit” onclick="click_button" text="Click me" runat="server"/>
<asp:button id=”Submit” onclick="click_button" text="Click me" runat="server"/>
User InterfaceUser Interface
Building Applications using ASP.NET and C# / Session 2 / 7 of 18
Click MeClick Me
LABEL
Click MeClick Me
Hello World
void click_btn(Object sender, EventArgs e){lbl.Text="Hello World";}
Event HandlersEvent Handlers
Building Applications using ASP.NET and C# / Session 2 / 8 of 18
_VIEWSTATE_VIEWSTATE
Name
E- mail
Password
Submit
King
******
Name
E- mail
Password
Submit
Building Applications using ASP.NET and C# / Session 2 / 9 of 18
Page_Load Page_Load EventEvent
Database Hello
World
Building Applications using ASP.NET and C# / Session 2 / 10 of 18
Process FlowProcess FlowExecution on
the server
1 2
3
User causes Postback4
HTTP Request
HTML
Page
Values after
Postback
Changes are processed
6
7
HTML
Page5
Building Applications using ASP.NET and C# / Session 2 / 11 of 18
ASP.NET ASP.NET Objects -1Objects -1
Building Applications using ASP.NET and C# / Session 2 / 12 of 18
ASP.NET Objects –2 ASP.NET Objects –2
Building Applications using ASP.NET and C# / Session 2 / 13 of 18
ASP.NET Objects – 3 ASP.NET Objects – 3
Building Applications using ASP.NET and C# / Session 2 / 14 of 18
Virtual Virtual DirectoriesDirectories
Building Applications using ASP.NET and C# / Session 2 / 15 of 18
PermissionsPermissions
Permissions
Building Applications using ASP.NET and C# / Session 2 / 16 of 18
HTTP Protocol HTTP Protocol
HTTP Response
HTTP Request
Building Applications using ASP.NET and C# / Session 2 / 17 of 18
Request & Request & ResponseResponse