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

<prefix:mycontrol id=con property=AnArray> ???!??!?

Any ideas on how you handle this in the control? I am using C# if that matters.

Want to pass an array or even do id.AnArray=myarry;
-Sal
Nov 18 '05 #1
4 963
Hi Sally:

This is generally done like:

<Custom:CollectionPropertyControl runat = "server">
<Custom:Employee Name = "Alice" Title = "Manager" />
<Custom:Employee Name = "Jerry" Title = "Programmer" />
<Custom:Employee Name = "Lynn" Title = "Architect" />
<Custom:Employee Name = "Mike" Title = "Tester" />
</Custom:CollectionPropertyControl>

Here we have an array of employees attached to the server control.

To pull this off you'll need to use the ParseChildrenAttribute
attribute. There is an example here:
http://msdn.microsoft.com/library/de...butesample.asp

HTH,

--
Scott
http://www.OdeToCode.com
On 9 Apr 2004 11:05:52 -0700, po**************@yahoo.com (Sally)
wrote:
Any ideas on how you handle this in the control? I am using C# if that matters.

Want to pass an array or even do id.AnArray=myarry;
-Sal


Nov 18 '05 #2
Thanks Scott, but what if the array is something determined at run
time (almost like a DataSource on a DataGrid)?
Scott Allen <bitmask@[nospam].fred.net> wrote in message news:<0v********************************@4ax.com>. ..
Hi Sally:

This is generally done like:

<Custom:CollectionPropertyControl runat = "server">
<Custom:Employee Name = "Alice" Title = "Manager" />
<Custom:Employee Name = "Jerry" Title = "Programmer" />
<Custom:Employee Name = "Lynn" Title = "Architect" />
<Custom:Employee Name = "Mike" Title = "Tester" />
</Custom:CollectionPropertyControl>

Here we have an array of employees attached to the server control.

To pull this off you'll need to use the ParseChildrenAttribute
attribute. There is an example here:
http://msdn.microsoft.com/library/de...butesample.asp

HTH,

--
Scott
http://www.OdeToCode.com
On 9 Apr 2004 11:05:52 -0700, po**************@yahoo.com (Sally)
wrote:
Any ideas on how you handle this in the control? I am using C# if that matters.

Want to pass an array or even do id.AnArray=myarry;
-Sal

Nov 18 '05 #3
Well, anything you can do in aspx you can also do programatically.

Take for instance the ListBox WebControl. You can add items in the
aspx file:

asp:ListBox id="ListBox1" runat="server" >
<asp:ListItem Value="1">item1s</asp:ListItem>
<asp:ListItem Value="2">item2</asp:ListItem>
</asp:ListBox>

Or you could add them programatically in the code behind:

ListBox1.Items.Add(new ListItem("item1", "1"));
ListBox1.Items.Add(new ListItem("item2", "2"));

or if you already have an array of ListItems declared, you can add
them all at once with the AddRange method.

If you already have an array or ArrayList of custom objects (with
public properties), you can use the use those objects as a DataSource.

HTH!
On 13 Apr 2004 09:48:52 -0700, po**************@yahoo.com (Sally)
wrote:
Thanks Scott, but what if the array is something determined at run
time (almost like a DataSource on a DataGrid)?
Scott Allen <bitmask@[nospam].fred.net> wrote in message news:<0v********************************@4ax.com>. ..
Hi Sally:

This is generally done like:

<Custom:CollectionPropertyControl runat = "server">
<Custom:Employee Name = "Alice" Title = "Manager" />
<Custom:Employee Name = "Jerry" Title = "Programmer" />
<Custom:Employee Name = "Lynn" Title = "Architect" />
<Custom:Employee Name = "Mike" Title = "Tester" />
</Custom:CollectionPropertyControl>

Here we have an array of employees attached to the server control.

To pull this off you'll need to use the ParseChildrenAttribute
attribute. There is an example here:
http://msdn.microsoft.com/library/de...butesample.asp

HTH,

--
Scott
http://www.OdeToCode.com
On 9 Apr 2004 11:05:52 -0700, po**************@yahoo.com (Sally)
wrote:
>Any ideas on how you handle this in the control? I am using C# if that matters.
>
>Want to pass an array or even do id.AnArray=myarry;
>
>
>-Sal


--
Scott
http://www.OdeToCode.com
Nov 18 '05 #4
Thanks Scott, everything you say helps me
-Sal

Scott Allen <bitmask@[nospam].fred.net> wrote in message news:<43********************************@4ax.com>. ..
Well, anything you can do in aspx you can also do programatically.

Take for instance the ListBox WebControl. You can add items in the
aspx file:

asp:ListBox id="ListBox1" runat="server" >
<asp:ListItem Value="1">item1s</asp:ListItem>
<asp:ListItem Value="2">item2</asp:ListItem>
</asp:ListBox>

Or you could add them programatically in the code behind:

ListBox1.Items.Add(new ListItem("item1", "1"));
ListBox1.Items.Add(new ListItem("item2", "2"));

or if you already have an array of ListItems declared, you can add
them all at once with the AddRange method.

If you already have an array or ArrayList of custom objects (with
public properties), you can use the use those objects as a DataSource.

HTH!
On 13 Apr 2004 09:48:52 -0700, po**************@yahoo.com (Sally)
wrote:
Thanks Scott, but what if the array is something determined at run
time (almost like a DataSource on a DataGrid)?
Scott Allen <bitmask@[nospam].fred.net> wrote in message news:<0v********************************@4ax.com>. ..
Hi Sally:

This is generally done like:

<Custom:CollectionPropertyControl runat = "server">
<Custom:Employee Name = "Alice" Title = "Manager" />
<Custom:Employee Name = "Jerry" Title = "Programmer" />
<Custom:Employee Name = "Lynn" Title = "Architect" />
<Custom:Employee Name = "Mike" Title = "Tester" />
</Custom:CollectionPropertyControl>

Here we have an array of employees attached to the server control.

To pull this off you'll need to use the ParseChildrenAttribute
attribute. There is an example here:
http://msdn.microsoft.com/library/de...butesample.asp

HTH,

--
Scott
http://www.OdeToCode.com
On 9 Apr 2004 11:05:52 -0700, po**************@yahoo.com (Sally)
wrote:

>Any ideas on how you handle this in the control? I am using C# if that matters.
>
>Want to pass an array or even do id.AnArray=myarry;
>
>
>-Sal

Nov 18 '05 #5

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

Similar topics

4
by: Sally | last post by:
Any ideas on how you handle this in the control? I am using C# if that matters. Want to pass an array or even do id.AnArray=myarry; -Sal
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.