My question is regarding a custom control which I created. This custom control derives from a ListProperty control.
public class CustomListProperty: ListProperty
Normally to call ListProperty on the page I use the following code:
<SharePoint:ListProperty Property="LinkTitle" runat="server"/>
But regarding my custom class I have 2 questions:
1) How can I add in my CustomListProperty a new property to the Property property? Because only this properties are available at this moment (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.listproperty.property)
So if I can put my own property I could call the value from property with following code:
<SharePoint:ListProperty Property="NewProperty" runat="server"/>
: so that my own value is shown (emphasis Property="NewProperty").
This modification I suppose should happen in Page_Load method. I could say:
base.Property = "NewProperty - somevalue"
But this way doesn't work. I tried to figure out how this Property property works .. I know it returns a string but I don't know how to add new properties to that.
2) The other question is: I want to create a new method in this customListProperty class which I would like to call just like property and it would return a string. What I means is:
public string CustomMethod(string sometext)
{
retrun sometext;
}
In the page I would add this:
<SharePoint:ListProperty CustomMethod="SomeText" runat="server"/>
How can I provide this kind of method to my control and is this possible? If it is possible how can I also call a method without parameter from the page?
<SharePoint:ListProperty CustomMethod="" runat="server"/>