I have a list of data, say "Supported colors". Maybe these colors each have a name, a set of aliases, a few specific RGB values that represent this color. In my site I have one page where I want to list the colors in a dropdown. In another page, I want to just have a grid displaying each color. Maybe in another page, something completely different. So my question is: how can I share the data between pages, such that a change in one location where the data is defined will propagate throughout all pages in the site.
Environment: This is an MVC app, using Razor (sparingly), bootstrap for presentation, and JQuery for some of the interactive operations.
My thoughts on a solution:
1) Store this list in a model that is passed to all pages. Then whenever the data is needed, I could loop over the items in the model, and present them however I want
2) Store the list in javascript, and generate the HTML using javascript instead.
3) Use JQuery to get the list from the server, and iterate over the results to generate the appropriate HTML
Note I am very new to web development, so there may be some false assumptions above, and most definitely some poorly thought out ideas - any corrections are greatly appreciated!