Array in the property of a webcontrol

  • Thread starter Thread starter Moreno Tonin
  • Start date Start date
M

Moreno Tonin

I'am creating a custom web control and I want that a property is an array of
class. how can I implement this?
I tried using:

public class myclass{
public string caption ="";
public myclass(){
}
}

public class obj: WebControl
{
private myclass _Items[] = null;
public myclass[] Items{
get{
return _Items;
}
set{
_Items = value.clone();
}
}
}
--
Moreno Tonin
e-mail: (e-mail address removed)
cell.: +393289026549
uff.: +39031525082
p. website: www.moredev.com

Datain srl
Microsoft Certified Partner
Telecom Business Service Provider
Progress Software Partner
via Lenticchia 16 22100 Como CO
www.datain.it ; www.datain.biz
 
The fact that it is a webcontrol is probably not relevant.

To define an array in C# you use
<qualifer> <TypeName>[] <fieldName>;

example:

private string[] Names;

If it is a type you have defined, eg, myclass, then

private myclass[] _Items;
public myclass[] Items { get { return _Items;} set {...}}


??
 
sorry I wrong to write in the forum
im my code is like what you write
but it doesn't run correttly


--
Moreno Tonin
e-mail: (e-mail address removed)
cell.: +393289026549
uff.: +39031525082
p. website: www.moredev.com

Datain srl
Microsoft Certified Partner
Telecom Business Service Provider
Progress Software Partner
via Lenticchia 16 22100 Como CO
www.datain.it ; www.datain.biz
 
Back
Top