A complex, poorly written ASP or PHP page can be a nightmare to maintain, because it usually mixes user interface markup, presentation logic, data access logic, and business or application logic all within the same page.
A Web form’s coded in C#.NET built using One Tier architecture:
<%@ Page Language=”C#” %>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<script runat=”server”>
protected void Button1_Click(object sender, EventArgs e)
{
WebPartZone1.WebPartVerbRenderMode = WebPartVerbRenderMode.TitleBar;
}
</script>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head id=”Head1″ runat=”server”>
<title>ONE TIER APPLICATION IN ASP.NET</title>
<style type=”text/css”>
h2
{
color:RED;
font-style:BOLD;
}
</style>
</head>
<body>
<form id=”form1″ runat=”server”>
<div>
<h2>How to set and change Menu to TitleBar in asp.net</h2>
<hr width=”250″ align=”left” color=”green” />
<br />
<asp:WebPartManager ID=”WebPartManager1″ runat=”server”>
</asp:WebPartManager>
<asp:WebPartZone
ID=”WebPartZone1″
runat=”server”
BackColor=”White”
Width=”250″
WebPartVerbRenderMode=”Menu” >
<ZoneTemplate>
<asp:Image
ID=”Image1″
runat=”server”
Title=”Octopus”
Width=”200″
/>
</ZoneTemplate>
</asp:WebPartZone>
<br />
<asp:Button
ID=”Button1″
runat=”server”
Text=”Change WebPartVerbRenderMode TitleBar”
OnClick=”Button1_Click”
ForeColor=”Blue”
Font-Bold=”true”
Height=”45″
/>
</div>
</form>
</body>
</html>
Let me first explain what are the differnt tiers, When the different elements in a system are organized systematically we talk about the system architecture. The architecture is the large- scale division of a system into layers or tiers, each with responsibility for a major part of the system and with as little direct influence on other layers as possible.
Different tiers are explained as follows:
One-tier applications
One-tier applications are normally simple isolated programs that don’t have network access.
Therefore it’s not necessary to take network communication and the risk of network failure into consideration. Neither do these programs need to think of synchronization of data,since all the data exists within the same application. When separating tiers physically the application will be slower due to the inevitable fact that communication over network will result in a loss of performance, therefore one-tier applications have high performance.
Two-tier applications
A two-tier application, in contrast to the one-tier application just described, does not combine all functions into a single process but separate different functions. A good example of this kind of application is a chat application. This kind of application contains two separated tiers, a client and a server. The client has the responsibility of capturing user input and displaying the actual messages. The server is responsible of the communication between
the people that uses the chat client.
Three-tier applications
A three-tier application, adds another tier to the previous mentioned chat application, this could be in the form of a database. One could think of a three-tier application as a dynamic web application, which has a user interface, business logic and a database each placed in different tiers, this is illustrated in Figure 3. As mentioned in the previous section a two-tier architecture separates the user interface from the business logic, in the same way the threetier architecture separates the database from the business logic.