Tải bản đầy đủ (.ppt) (30 trang)

Asp.net slide2

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (2.04 MB, 30 trang )

Session 3
Objects in ASP.NET

Exploring ASP.NET / Session 3 / 2 of 30
Review

Active Server Pages (ASP) is a server-side scripting environment that
provides a web server with the capability to process application logic,
and return standard HTML pages to the browser.

Web Forms provides a form designer, an editor and debugging tools,
which can be used to rapidly build server-based, programmable user
interfaces for browsers and Web client devices.

The Design view displays the page layout of the web page as it
would be displayed in the browser.

The HTML view displays the code that is automatically generated to
create the Web page.

AssemblyInfo.cs is the file that contains information about the
project. It contains information such as name, version, and culture
information.

Once the code has been compiled, the CLR further compiles the IL to
native code, when the request for the web page is encountered,
providing improved performance.

Exploring ASP.NET / Session 3 / 3 of 30
Review Contd…


Web.config is an XML based file. It holds unique configuration
information about each URL used in the project.

Global.asax is an optional file that is used for handling application-
level events.

The web page created either using the editor or Web Forms, is first
complied to Intermediate Language (IL), including server scripts.

The different web pages of an application created using Web Forms,
and the program code within it, are compiled into a single assembly /
dynamic link library (.dll) file.

In the editor based web application, separate dynamic link libraries
(.dll's) are created for each file.

The web pages created using Web Forms, will have the Codebehind
attribute that informs Web Forms IDE about the code file that has to
be changed whenever a change is made to the Design, or the HTML
view of the Web Form.

Exploring ASP.NET / Session 3 / 4 of 30
Objectives

Explain the basics of ASP.NET

Discuss the process flow of a .aspx
page

Explain the

Page_Load
event

Discuss the
IsPostBack
property of
the
Page
object

Use the
Request
and
Response

Objects

Exploring ASP.NET / Session 3 / 5 of 30
An ASP.NET Page
Page Directive
<SCRIPT> section
Page_Load Event
Event Handler
HTML Control
Web Control

Exploring ASP.NET / Session 3 / 6 of 30
An ASP.NET Page - Output
Output after the Page
Load Event

Output after the Button
Click Event

Exploring ASP.NET / Session 3 / 7 of 30
Starting with ASP.NET
<%@ Page Language=”C#” %>
<script language = "C#" runat="server">
</script>

Exploring ASP.NET / Session 3 / 8 of 30
<input type="button" id="Submit"
runat="server" value="Click"/>
<asp:button id=”Submit”
onclick="click_button"
text="Click me" runat="server"/>
User Interface

Exploring ASP.NET / Session 3 / 9 of 30
LABEL
Click Me
Hello World
void
click_btn(Obj
ect sender,
EventArgs e)
{lbl.Text=
"Hello
World";}
Event Handlers


Exploring ASP.NET / Session 3 / 10 of 30
Event Handlers - Example
<% @ Page Language = "C#" Debug = "true"%>
<html>
<script language = "C#" runat="server">
void Page_Load(Object sender, EventArgs e)
{
//code for page load
}
void buttonRefresh(Object sender, EventArgs e)
{
Page_Load(sender,e);
}

Exploring ASP.NET / Session 3 / 11 of 30
Example Contd…
</script>
<body>
<form runat="server">
<asp:button id="btnRefresh"
onclick="buttonRefresh" text="Refresh" runat="server"/>
<br>
<br>
</form>
</body>
</html>

Exploring ASP.NET / Session 3 / 12 of 30
_VIEWSTATE
Name

E- mail
Password
Submit
King

******
Name
E- mail
Password
Submit

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×