To answer your question: I don’t think ASP.NET MVC provides a concept for this.
From my understanding however, you are asking a general application design question: Where can I store my UI-specific information? As you do not want to mix it with you actual data, which I understand, you need to store it somewhere else. That’s a fact. ;)
I think there are different approaches, how and where to save this information, each having their pros and cons:
Text file (JSON, XML, etc.)
Pros:
- Almost no implementation effort
- "Easy" to access (see cons)
- Easy to adjust once schema changes
Cons:
- You need physical access to the server or at least a chance to upload it to the server. Depending on you environment you might not have this.
- Might get messy (that’s why you’re righting this post, right?)
- Error prone (I mean, what validation do you have with a text file?)
Database (either the existing one or a new one, containing GUI/application related information)
Pros:
- Clean and structured schema (and you are trying to save structured data you said)
- All data is in a database (= not on a webserver’s hard drive) which makes it easier for migrations, updates etc.
- Just sounds better than editing a text file, but that’s my personal opinion
Cons:
- High implementation effort (you need to create forms to add, edit and delete items, etc. – unless you manually want to add the data to database?)
String Resources (resx)
This seams kind of the right place, as you’re storing language dependent information and apparently can be changed during production without recompiling, depending on your project structure:
Editing resource files without recompiling ASP.NET application
It’s hard to say, what you want and need, as it also depends on the policies in your company, etc.
Another factor is, how often does this data change and who should be able to change it? As you are talking about CSS classes and URLs, it sounds like something a technical guy does, but you never know..
I think I would go for a database containing the GUI related stuff. If you can’t mix it with the actual application data, why shouldn’t you create a new one containing data explicitly for the front end? Maybe there will be or already is additional information than what you are referring to, which could go there too.
If a database is no option I would create a serializable (cached and Singleton) class containing the structure you need and the XML/JSON is then stored on the filesystem. If you have time, you can even create a UI to edit this class/file.. I mean, if only technical guys are editing this, then it doesn't need to be anything fancy..