Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Implementing the Observer Pattern

, 5 Feb 2008
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)

Share

About the Author

Huthaifa Afanah
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.

| Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 5 Feb 2008
Article Copyright 2008 by Huthaifa Afanah
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid