I want to pass an int list (List) as a declarative property to a web user control like this:
The way I normally do this is to make the property wrap the ViewState collection. Your way looks better if it can be made to work, but this will get the job done:
public IList ModuleIds
{
get
{
string moduleIds = Convert.ToString(ViewState["ModuleIds"])
IList list = new Collection();
foreach(string moduleId in moduleIds.split(","))
{
list.Add(Convert.ToInt32(moduleId));
}
return list;
}
}