I have class in c#
public class CompositeResource : Control
{
[PersistenceMode(PersistenceMode.InnerDefaultProperty)]
public ResourceCollection Resources { get { return _resources; } }
}
public class Resource
{
[Bindable(true), DefaultValue(""), Editor("System.Web.UI.Design.UrlEditor, System.Design, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(UITypeEditor)), Description("Specifies the URL of a resource to reference in the CompositeControl. The URL may be relative, root relative or absolute."), UrlProperty]
public String Url { get; set; }
[Bindable(true), DefaultValue(""), Description("Specifies the name of a resource to be used as a reference in the CompositeControl. The ReferenceName is typically used in conjunction with the Sprite control.")]
public String ReferenceName { get; set; }
}
public class ResourceCollection : List<Resource>
{
}
I just need to add multiple resource like
CompositeResource cr = new CompositeResource();
cr.Type = Xpedite.Resources.ResourceType.Css;
cr.ReferenceName = "hello";
cr.Resources.Add({new Resource().Url="\style\p1.css",new Resource().Url="\style\p2.css" });
but the last line giving me the error when I want add multiple resources and each resource instance has property like url.
I think i am wrong but not being able to capture where is there problem.
Your syntax is wrong
should be