More in this section
Forums / Sitefinity SDK / Resource field

Resource field

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Daniel Plomp
    Daniel Plomp avatar
    112 posts
    Registered:
    14 Jun 2012
    06 Jun 2011
    Link to this post
    Hi,

    Just a quick question about resource properties:
    Following this code:

    var addressSection = new ContentViewSectionElement(detailView.Sections) {
                    Name = "AddressSection",
                    Title = "AddressSection",
                    ResourceClassId = typeof(CompaniesResources).Name,
                    CssClass = "sfExpandableForm",
                    ExpandableDefinitionConfig = { Expanded = true }
                };

    Which property do I have to use in my resource class as the key of the resource? I expect it to be the 'Name' property, but that doesn't work.

    Regards,
    Daniel
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    09 Jun 2011
    Link to this post
    Hi Daniel ,

    Yes, you should use the name

    typeof(TypeResources).Name

    TypeResourcesis the type, but the key might me

    The custom resource class should have the following attribute

    [ObjectInfo("TypeResources", ResourceClassId = "TypeResources", TitlePlural = "TypeResourcesTitlePlural")]
        public sealed class TypeResources: Resource\


    where you have resource entries

            [ResourceEntry("ControlsTitle",
                           Value = "Fields",
                           Description = "The title of the toolbox for designing items.",
                           LastModified = "2011/05/20")]
            public string ControlsTitle
            {
                get
                {
                    return this["ControlsTitle"];
                }
            }

       
            [ResourceEntry("ControlsDescription",
                           Value = "A collection of reusable fields.",
                           Description = "The description of the toolbox for designing items.",
                           LastModified = "2011/05/20")]
            public string ControlsDescription
            {
                get
                {
                    return this["ControlsDescription"];
                }
            }

            /// <value>Title plural for the items module.</value>
            [ResourceEntry(
                "TypeResourcesTitlePlural",
                Value = "Forms",
                Description = "Title plural for the module.",
                LastModified = "2011/05/01")]
            public string TypeResourcesTitlePlural
            {
                get { return this["TypeResourcesTitlePlural"]; }
            }

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

2 posts, 0 answered