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

ASP.NET User Controls - Notify One Control Of Changes In Other Control

Rate me:
Please Sign up or sign in to vote.
4.39/5 (23 votes)
12 Mar 20026 min read 195.3K   2.6K   87  
A tutorial on how to use delegate model to notify one ASP.NET user control of changes in the other user control.
<VisualStudioProject>
    <CSHARP
        ProjectType = "Web"
        ProductVersion = "7.0.9466"
        SchemaVersion = "1.0"
        ProjectGuid = "{C5471F1F-C439-4D46-8EBC-7F0572FD747E}"
    >
        <Build>
            <Settings
                ApplicationIcon = ""
                AssemblyKeyContainerName = ""
                AssemblyName = "ASPNet_App"
                AssemblyOriginatorKeyFile = ""
                DefaultClientScript = "JScript"
                DefaultHTMLPageLayout = "Grid"
                DefaultTargetSchema = "IE50"
                DelaySign = "false"
                OutputType = "Library"
                RootNamespace = "ASPNet_App"
                StartupObject = ""
            >
                <Config
                    Name = "Debug"
                    AllowUnsafeBlocks = "false"
                    BaseAddress = "285212672"
                    CheckForOverflowUnderflow = "false"
                    ConfigurationOverrideFile = ""
                    DefineConstants = "DEBUG;TRACE"
                    DocumentationFile = ""
                    DebugSymbols = "true"
                    FileAlignment = "4096"
                    IncrementalBuild = "true"
                    Optimize = "false"
                    OutputPath = "bin\"
                    RegisterForComInterop = "false"
                    RemoveIntegerChecks = "false"
                    TreatWarningsAsErrors = "false"
                    WarningLevel = "4"
                />
                <Config
                    Name = "Release"
                    AllowUnsafeBlocks = "false"
                    BaseAddress = "285212672"
                    CheckForOverflowUnderflow = "false"
                    ConfigurationOverrideFile = ""
                    DefineConstants = "TRACE"
                    DocumentationFile = ""
                    DebugSymbols = "false"
                    FileAlignment = "4096"
                    IncrementalBuild = "false"
                    Optimize = "true"
                    OutputPath = "bin\"
                    RegisterForComInterop = "false"
                    RemoveIntegerChecks = "false"
                    TreatWarningsAsErrors = "false"
                    WarningLevel = "4"
                />
            </Settings>
            <References>
                <Reference
                    Name = "System"
                    AssemblyName = "System"
                    HintPath = "..\..\..\WINNT\Microsoft.NET\Framework\v1.0.3617\System.dll"
                />
                <Reference
                    Name = "System.Drawing"
                    AssemblyName = "System.Drawing"
                    HintPath = "..\..\..\WINNT\Microsoft.NET\Framework\v1.0.3617\System.Drawing.dll"
                />
                <Reference
                    Name = "System.Data"
                    AssemblyName = "System.Data"
                    HintPath = "..\..\..\WINNT\Microsoft.NET\Framework\v1.0.3617\System.Data.dll"
                />
                <Reference
                    Name = "System.Web"
                    AssemblyName = "System.Web"
                    HintPath = "..\..\..\WINNT\Microsoft.NET\Framework\v1.0.3617\System.Web.dll"
                />
                <Reference
                    Name = "System.XML"
                    AssemblyName = "System.Xml"
                    HintPath = "..\..\..\WINNT\Microsoft.NET\Framework\v1.0.3617\System.XML.dll"
                />
                <Reference
                    Name = "System.DirectoryServices"
                    AssemblyName = "System.DirectoryServices"
                    HintPath = "..\..\..\WINNT\Microsoft.NET\Framework\v1.0.3617\System.DirectoryServices.dll"
                />
            </References>
        </Build>
        <Files>
            <Include>
                <File
                    RelPath = "ADSIGroup.cs"
                    SubType = "Code"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "ADSIObject.cs"
                    SubType = "Code"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "ADSIUser.cs"
                    SubType = "Code"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "ADSIUsers.cs"
                    SubType = "Code"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "ADSIUtil.cs"
                    SubType = "Code"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "Analysis.aspx"
                    SubType = "Form"
                    BuildAction = "Content"
                />
                <File
                    RelPath = "Analysis.aspx.cs"
                    DependentUpon = "Analysis.aspx"
                    SubType = "ASPXCodeBehind"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "Analysis.aspx.resx"
                    DependentUpon = "Analysis.aspx.cs"
                    BuildAction = "EmbeddedResource"
                />
                <File
                    RelPath = "ASPNet_App.vsdisco"
                    BuildAction = "None"
                />
                <File
                    RelPath = "AssemblyInfo.cs"
                    SubType = "Code"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "BannerAds.aspx"
                    SubType = "Form"
                    BuildAction = "Content"
                />
                <File
                    RelPath = "BannerAds.aspx.cs"
                    DependentUpon = "BannerAds.aspx"
                    SubType = "ASPXCodeBehind"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "BannerAds.aspx.resx"
                    DependentUpon = "BannerAds.aspx.cs"
                    BuildAction = "EmbeddedResource"
                />
                <File
                    RelPath = "BrowInfoXMLNode.xml"
                    BuildAction = "Content"
                />
                <File
                    RelPath = "BrowserCaps.cs"
                    SubType = "Code"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "BrowserChk.aspx"
                    SubType = "Form"
                    BuildAction = "Content"
                />
                <File
                    RelPath = "BrowserChk.aspx.cs"
                    DependentUpon = "BrowserChk.aspx"
                    SubType = "ASPXCodeBehind"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "BrowserChk.aspx.resx"
                    DependentUpon = "BrowserChk.aspx.cs"
                    BuildAction = "EmbeddedResource"
                />
                <File
                    RelPath = "Default.aspx"
                    SubType = "Form"
                    BuildAction = "Content"
                />
                <File
                    RelPath = "Default.aspx.cs"
                    DependentUpon = "Default.aspx"
                    SubType = "ASPXCodeBehind"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "Default.aspx.resx"
                    DependentUpon = "Default.aspx.cs"
                    BuildAction = "EmbeddedResource"
                />
                <File
                    RelPath = "Global.asax"
                    SubType = "Component"
                    BuildAction = "Content"
                />
                <File
                    RelPath = "Global.asax.cs"
                    DependentUpon = "Global.asax"
                    SubType = "Code"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "Global.asax.resx"
                    DependentUpon = "Global.asax.cs"
                    BuildAction = "EmbeddedResource"
                />
                <File
                    RelPath = "SecurityUtils.aspx"
                    SubType = "Form"
                    BuildAction = "Content"
                />
                <File
                    RelPath = "SecurityUtils.aspx.cs"
                    DependentUpon = "SecurityUtils.aspx"
                    SubType = "ASPXCodeBehind"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "SecurityUtils.aspx.resx"
                    DependentUpon = "SecurityUtils.aspx.cs"
                    BuildAction = "EmbeddedResource"
                />
                <File
                    RelPath = "SoftomatixStyles.css"
                    BuildAction = "Content"
                />
                <File
                    RelPath = "Web.config"
                    BuildAction = "Content"
                />
                <File
                    RelPath = "WebLogDBManager.cs"
                    SubType = "Code"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "WebLogManager.cs"
                    SubType = "Code"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "Controls\BannerChangeEventArgs.cs"
                    SubType = "Code"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "Controls\SiteBanner.ascx"
                    SubType = "UserControl"
                    BuildAction = "Content"
                />
                <File
                    RelPath = "Controls\SiteBanner.ascx.cs"
                    DependentUpon = "SiteBanner.ascx"
                    SubType = "ASPXCodeBehind"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "Controls\SiteBanner.ascx.resx"
                    DependentUpon = "SiteBanner.ascx.cs"
                    BuildAction = "EmbeddedResource"
                />
                <File
                    RelPath = "Controls\SiteBannerManager.ascx"
                    SubType = "UserControl"
                    BuildAction = "Content"
                />
                <File
                    RelPath = "Controls\SiteBannerManager.ascx.cs"
                    DependentUpon = "SiteBannerManager.ascx"
                    SubType = "ASPXCodeBehind"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "Controls\SiteBannerManager.ascx.resx"
                    DependentUpon = "SiteBannerManager.ascx.cs"
                    BuildAction = "EmbeddedResource"
                />
                <File
                    RelPath = "Controls\SiteCopyright.ascx"
                    SubType = "UserControl"
                    BuildAction = "Content"
                />
                <File
                    RelPath = "Controls\SiteCopyright.ascx.cs"
                    DependentUpon = "SiteCopyright.ascx"
                    SubType = "ASPXCodeBehind"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "Controls\SiteCopyright.ascx.resx"
                    DependentUpon = "SiteCopyright.ascx.cs"
                    BuildAction = "EmbeddedResource"
                />
                <File
                    RelPath = "Controls\SiteFooter.ascx"
                    BuildAction = "Content"
                />
                <File
                    RelPath = "Controls\SiteFooter.ascx.cs"
                    DependentUpon = "SiteFooter.ascx"
                    SubType = "ASPXCodeBehind"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "Controls\SiteFooter.ascx.resx"
                    DependentUpon = "SiteFooter.ascx.cs"
                    BuildAction = "EmbeddedResource"
                />
                <File
                    RelPath = "Controls\SiteHeader.ascx"
                    SubType = "UserControl"
                    BuildAction = "Content"
                />
                <File
                    RelPath = "Controls\SiteHeader.ascx.cs"
                    DependentUpon = "SiteHeader.ascx"
                    SubType = "ASPXCodeBehind"
                    BuildAction = "Compile"
                />
                <File
                    RelPath = "Controls\SiteHeader.ascx.resx"
                    DependentUpon = "SiteHeader.ascx.cs"
                    BuildAction = "EmbeddedResource"
                />
                <Folder RelPath = "Images\" />
                <File
                    RelPath = "Styles\SiteFooter.css"
                    BuildAction = "Content"
                />
            </Include>
        </Files>
    </CSHARP>
</VisualStudioProject>

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
To learn more about us, Please visit us at http://www.netomatix.com

Comments and Discussions