making a string[] as a public property for a custom server control

P

PeterKellner

I'm wanting a list of strings as an attribute for my custom server
control. I can get a single string to work but when I change my
declaration to string[], I get in error when the control instantiates
saying can't create object of type System.String[].

Can someone tell me what the correct way to declare the string[] is?
This is what I have that does not work:

[Category("Data")]
[Themeable(false)]
[Description("Get or Sets the List of Roles To Include")]
public virtual string[] RolesToInclude
{
get
{
string[] o = (string[]) ViewState["RolesToInclude"];
if (o == null)
return null;
return (string[])o;
}
set { ViewState["RolesToInclude"] = value; }
}
Peter Kellner
http://peterkellner.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top