473,396 Members | 1,967 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,396 software developers and data experts.

How to get child controls not be treated as properties ?

Hi,

I'm trying to create a control that contains other controls. But the problem
is that child controls are treated as properties, and page could not be
parsed.

Parser Error Message: Type 'DataEntryPage' does not have a property named
'asp:Button'.

Source Error:

Line 46: <my:dataentrypage id="pgMissingCoverages"
runat="server">
Line 47: <asp:Button ID="fdfs" Text="dsasda"
Runat="server" />
Line 48: </my:dataentrypage>

Is there a way to get child controls into Controls collection instead of
properties?

Thanks in advance.
Dmitriy.
Nov 18 '05 #1
2 1363
You would have to develop a Templated Control to use in that manner.
Otherwise, add the Button to its Controls programmatically.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Dmitriy Zakharov" <dm********@yahoo.com> wrote in message
news:uS**************@TK2MSFTNGP09.phx.gbl...
Hi,

I'm trying to create a control that contains other controls. But the problem is that child controls are treated as properties, and page could not be
parsed.

Parser Error Message: Type 'DataEntryPage' does not have a property named
'asp:Button'.

Source Error:

Line 46: <my:dataentrypage id="pgMissingCoverages"
runat="server">
Line 47: <asp:Button ID="fdfs" Text="dsasda"
Runat="server" />
Line 48: </my:dataentrypage>

Is there a way to get child controls into Controls collection instead of
properties?

Thanks in advance.
Dmitriy.

Nov 18 '05 #2
I figured it out. I should declare my user control as

<ParseChildren(False)> _
Public Class DataEntryPage
....
End Class

The parameter of ParseChildren attribute controls whether child controls
should be treated as properties, or as child controls. Thanks for pointing
out a direction.

Regards,
Dmitriy.
"Kevin Spencer" <ks******@takempis.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
You would have to develop a Templated Control to use in that manner.
Otherwise, add the Button to its Controls programmatically.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Dmitriy Zakharov" <dm********@yahoo.com> wrote in message
news:uS**************@TK2MSFTNGP09.phx.gbl...
Hi,

I'm trying to create a control that contains other controls. But the

problem
is that child controls are treated as properties, and page could not be
parsed.

Parser Error Message: Type 'DataEntryPage' does not have a property named 'asp:Button'.

Source Error:

Line 46: <my:dataentrypage id="pgMissingCoverages"
runat="server">
Line 47: <asp:Button ID="fdfs" Text="dsasda"
Runat="server" />
Line 48: </my:dataentrypage>

Is there a way to get child controls into Controls collection instead of
properties?

Thanks in advance.
Dmitriy.


Nov 18 '05 #3

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

Similar topics

10
by: Barbara Alderton | last post by:
I am working with SharePoint 2003. I am using (using C#) an existing webpart as a child control (server control). I need to access/manipulate the HTML that the control outputs prior to rendering...
0
by: AinO | last post by:
Hi, (VS2003/c# - System.Windows.Forms) I have two panels on a parent panel, where one is docked top and the second docked client area. They both have their Visible property = false at design...
5
by: Jonathan Williams | last post by:
Hi, I have an object which inherits from WebControl (CUSTOM : WebControl) In this object I have code in which I add child contols: protected override void CreateChildControls() {...
2
by: Juan Romero | last post by:
Hey guys, I am working on a web custom control that basically draws a table (ASP Table) with a few child controls in the cells. I have a command button inside one of these cells. The problem I...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
2
by: JohnR | last post by:
Let's say I have an MDI parent form with a textbox. If I create an MDI child form and, at runtime, move the MDI child window over the textbox on the MDI parent, the textbox appears in front of the...
1
by: Mark Hoffy | last post by:
Hello, I have an MDI app. There are many child forms and they all have several things in common. They all have a Save button, a public variable boolNavigate, and they all have a TreeView...
4
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if...
5
by: Earl | last post by:
I need to call a method on an owned child form, and am wondering if the best way of doing this is to capture the Closing event of the form that passes control back to the form where I have the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.