You might get some help from this blog post: http://world.episerver.com/blogs/Per-Magne-Skuseth/Dates/2014/3/Attribute-based-default-values/
Hello Radek
These are standard C# attributes so these posts may be of help:
https://msdn.microsoft.com/en-us/library/71s1zwct(v=vs.110).aspx
http://stackoverflow.com/questions/6637679/reflection-get-attribute-name-and-value-on-property
David
Lovely guys, thank you.
I was doing it all wrong. Trying to get the attribute from page.Property (the property collection ).
Once again thanks alot
Hi,
i am trying to get the attributes of my properties:
Example:
XXXPageBase : PageData
[Display(Name = "My Property 1", Description = "Property One", Order = 100, GroupName = Global.GroupNames.Specialized)]
[UIHint("MyUIHint")]
public virtual string MyProp { get; set; }
And then on Published event:
[ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
public class CustomizedRenderingInitialization : IInitializableModule
...........
private void Events_PublishingContent(object sender, ContentEventArgs e)
{
if (e.Content is XXXPageBase )
{
var page = e.Content as XXXPageBase ;
????How do i get the attribute of property: MyProp ????
I would like to get hold of the Description and UiHint value
}
}