SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a web part with a WebDescription attribute that contains a description of the web part. E.g.

    WebDescription("Setting this option will make sorting, paging, filtering and refresh operations asynchronous"),
    WebDisplayName("Enable Asychronous Update")
    public bool EnableAsyncUpdate
            return _enableAsyncUpdate;
            _enableAsyncUpdate = value;

I want to dynamically change the WebDescription value by pulling a string from a resource file. E.g.


but the WebDescription attribute only accepts constants. Is there another way to dynamically populate the WebDescription attribute of a WebPart?

share|improve this question

I've faced a similar problem before. Can't remember if this solution actually worked, but you could try creating a class that inherits from WebDescriptionAttribute and use the constructor to pass in your resource key instead of the resource string itself.

Then override the Description property to read the resource from the resource manager.

Something like this

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.