Click here to Skip to main content
15,896,207 members
Articles / Web Development / ASP.NET

Implementing the Observer Pattern

Rate me:
Please Sign up or sign in to vote.
3.48/5 (13 votes)
5 Feb 2008CPOL4 min read 64.8K   302   41  
An article that discusses how to implement the observer pattern
<%@ Control Language="C#" AutoEventWireup="true" Inherits="ObserverTutorial.Address_UC" Codebehind="Address_UC.ascx.cs" %>
<%@ Register Src="RecordDetails_UC.ascx" TagName="RecordDetails_UC" TagPrefix="uc1" %>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td>
            <fieldset style="border-right: black 1px solid; border-top: black 1px solid; border-left: black 1px solid; border-bottom: black 1px solid">
                <legend style="border-right: black 1px solid; border-top: black 1px solid; border-left: black 1px solid; border-bottom: black 1px solid">
                    <asp:Label ID="lblContactAddressDetails" runat="server" Text="Address Details"></asp:Label></legend>
                <table style="width: 100%">
                    <tr>
                        <td class="data">
                            <asp:Label ID="lblCountryName" runat="server" CssClass=" " Text="Country Name"></asp:Label></td>
                        <td class="data">
                            <asp:TextBox ID="txtCountry" runat="server" CssClass="txt" Width="160px"></asp:TextBox></td>
                        <td class="data"  >
                            <asp:Label ID="lblCityName" runat="server" Text="City Name"></asp:Label></td>
                        <td class="data">
                            <asp:TextBox ID="txtCity" runat="server" CssClass="txt" Width="160px"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td class="data">
                            <asp:Label ID="lblPostCode" runat="server" Text="Postal Code" CssClass=" "></asp:Label></td>
                        <td class="data">
                            <asp:TextBox ID="txtPostalCode" runat="server" CssClass="txt" Width="160px"></asp:TextBox></td>
                        <td class="data"  >
                            <asp:Label ID="lblState" runat="server" Text="State"></asp:Label></td>
                        <td class="data">
                            <asp:TextBox ID="txtState" runat="server" Width="160px" CssClass="txt"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td class="data" style="width: 130px">
                            <asp:Label ID="lblStreet" runat="server" Text="Street" CssClass=" "></asp:Label></td>
                        <td class="data">
                            <asp:TextBox ID="txtStreet" runat="server" Width="160px" CssClass="txt"></asp:TextBox></td>
                        <td class="data" >
                            <asp:Label ID="lblBuilding" runat="server" Text="Building"></asp:Label></td>
                        <td class="data">
                            <asp:TextBox ID="txtBuilding" runat="server" Width="160px" CssClass="txt"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td class="data" style="width: 130px">
                            <asp:Label ID="lblAddressId" runat="server" CssClass=" " Text="Address Id"></asp:Label></td>
                        <td class="data">
                            <asp:TextBox ID="txtAddressId" runat="server" CssClass="txt" Width="160px"></asp:TextBox></td>
                        <td class="data">
                        </td>
                        <td class="data">
                        </td>
                    </tr>
                </table>
            </fieldset>
            <uc1:RecordDetails_UC id="RecordDetails_UC1" runat="server">
            </uc1:RecordDetails_UC></td>
    </tr>
    <tr>
        <td>
            &nbsp;&nbsp;
            <asp:Button ID="btnReset" runat="server" CssClass="btn" Text="Reset" />
            &nbsp;
            <asp:Button ID="btnSave" runat="server" CssClass="btn" Text="Save" OnClick="btnOk_Click" /></td>
    </tr>
</table>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer NTS
Palestinian Territory (Occupied) Palestinian Territory (Occupied)
Huthaifa lives happily in Jerusalem and enjoys his time developing web applications and learning new stuff.

Comments and Discussions