473,394 Members | 1,761 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

problems using CompositeControl base class

my composite control does not render correctly the 2nd time it is made
visible. When I change the base class from CompositeControl to
WebControl, the control works as it should.

public class RowPrompt2 : System.Web.UI.WebControls.WebControl,
INamingContainer
// public class RowPrompt2 :
System.Web.UI.WebControls.CompositeControl, INamingContainer
{
}

In CreateChildControls I clear controls, create a Panel control, then
create controls within the Panel.
protected override void CreateChildControls()
{
Controls.Clear();
...
}

when I switch to WebControl as the base class I have to comment out
the RecreateChildControls method:
// protected override void RecreateChildControls()
// {
// EnsureChildControls();
// }

In Render, I let the base class do the work:
protected override void Render(HtmlTextWriter InWriter)
{
base.Render(InWriter);
}

that is it. no other methods are overridden.

what is happening is, when the control is made visible the 2nd time,
the Panel which contains a series of Label, TextBox pairs followed by
two Buttons, is rendered with one label and a button with the text
value of one of the Labels.

I dont see what I could be doing wrong since when I change to the
WebControl base it renders correctly. Do I get a prize for finding a
bug in CompositeControl, or am I the one with the bug?

thanks,

-Steve

Jun 2 '07 #1
0 1001

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
14
by: multiformity | last post by:
So I have been working on an opensource project for a while, and decided to really try to make it look better after focusing on the functionality most of this time. Up to now, I have simply used a...
8
by: Spam Trap | last post by:
I am getting strange resizing problems when using an inherited form. Controls are moving themselves seemingly randomly, but reproducibly. "frmBase" is my base class (a windows form), and...
1
by: Mantorok | last post by:
Hi all I finally got around to creating some WebControl classes, however I want to add some validation to my custom control, it's a descendant of CompositeControl. I get the exception: Unable...
3
by: cashdeskmac | last post by:
I have created a composite control in C# which shows a DropDownList with 4 items and when one is selected a relevant message appears in a TextBox. This works fine. I then tried to recreate the...
2
by: Electric Co. | last post by:
Hello, I have two questions: 1.) How successfully does ASP.NET 2005 handle custom composite controls nested inside of custom composite controls? For example:
3
by: Eric | last post by:
I've created a control that inherits from CompositeControl. I want to use this control as a base for other composite controls to inherit from. The problem is that any controls that inherit from...
0
by: Christian | last post by:
Hi all, i already posted this in dotnet.vb.controls but i need some help, so i cant wait... I have written a web control library and have some problems with it. The Library contains only two...
6
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... Tried posting this on Build Controls but then saw that's a pretty slow group... Kind of a typical request from product management - they want to be able to swap in different 3rd party...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.