Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 1st, 2006, 05:40 AM
Registered User
Join Date: Aug 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Composite Control Part 2

Hi all.

Having created my composite control, I would like to simplify the usage of the component. The component needs to be binded to a control on the Web Form (very much like a RangeValidator control).

Currently, the properties of my component requires you to type the name of the correct component. However, this allows room for error, and it also allows someone to break the code by entering a name of an incompatible binding component.

My Composite Control can only be binded with a GridView Control, Datalist Control, and a Repeater Control. Therefore, the ideal solution would be a drop down in the properties of my component which is populated with the names of the valid components which are on the same page.

While this is done in some of the built in ASP.NET 2 Components, I cannot find any resources to help me achieve this.

Any help or suggestions would be appreciated.

With thanks,
Orig Jones.
Old September 15th, 2006, 08:28 AM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Hi there,

This may be a bit late, but you can take a look here:



Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to: The Only Mistake by Joy Division (Track 18 from the album: Heart And Soul (CD 1)) What's This?
Old September 18th, 2006, 03:28 AM
Registered User
Join Date: Aug 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts

Thankyou Imar, this was a really helpfull link.

If anyone is curious, I re-used the same code, except that I changed the main if-statement to check if each component was of type Repeater, or DataGrid since my control was only applicable to one of these controls:

        protected override Boolean IncludeControl(Control serverControl)
            if ((serverControl is Repeater) || (serverControl is DataGrid))
                return true;
                return false;

With thanks,


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing Templates in a Composite Control dparsons ASP.NET 2.0 Professional 0 April 24th, 2008 12:28 PM
Chp.5 composite control properties studen77 BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 1 October 6th, 2006 03:35 PM
Building composite Control with Image + DDL mehdi_tn ASP.NET 2.0 Professional 1 April 12th, 2006 10:48 PM
PLEASE HELP - Composite Control brettk_1 ASP.NET 1.0 and 1.1 Professional 0 August 3rd, 2005 06:22 AM
Composite Control bmains .NET Framework 2.0 0 July 25th, 2005 12:57 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.