2

I want to access some configuration data stored in the property bag. I want to access this information from a elements.xml file. This elements.xml file contains a Ribbon with Tabs and Buttons. Is there a way to do this? Or a way to access a static public string from an elements.xml file?

The Ribbon and its child controls are all inside a element.

2 Answers 2

2

Not in then xml, but when you create ribbon buttons you specify javascript to execute when clicked.

You then have two options:

  1. Use Client Object Model in this javascript to retrieve the property and do the navigation
  2. Navigate to a trampolin page which reads the property and redirects
0
2

As far as I'm aware, there's no way to access the object model in that way from a static XML file. You'd need code to pull the property you're referring to.

7
  • I can pull the property via code, and store it in a public string. Is there anyway to access that string from the xml file? Commented May 25, 2012 at 2:05
  • XML is markup... it can't pull dynamic values.
    – webdes03
    Commented May 25, 2012 at 2:23
  • What if it was a public static string that was setup on PreLoad or something like that? Before the control got rendered the string would already be populated with the correct property value. Commented May 25, 2012 at 2:26
  • 1
    There's no such thing as a variable or a placeholder for the XML. Short of having something else generate the entire elements.xml file, I don't believe what you're doing is possible. Even considering that the elements.xml file is a static file stored within the solution and 14 hive, I'm not sure how you'd accomplish this. What are you trying to do?
    – webdes03
    Commented May 25, 2012 at 2:28
  • I had part of a url stored in the property bag. I also have a ribbon with buttons. When a user clicks one of the buttons, it is supposed to go to a certain url stored in the property bag. I have the buttons declared through xml rather than code behind. I would like to set the buttons commanduihandler to the url stored in the property bag. Commented May 25, 2012 at 2:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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