© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
13 replies
KidKai25

✅ Is it a good idea to store CSS class as a property in my C# model?

Example

class UserStatus
{
string StatusName {get;set;}
string StyleClass {get;set;}
}
class UserStatus
{
string StatusName {get;set;}
string StyleClass {get;set;}
}


Then I store like
"Online","green-circle"
"Offline", "red-circle"
Or should I check the status and then add the css in my js code itself?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,828Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

❔ What is the purpose of `ModelBindingContext.Model`, `ModelName`, and `ModelBinderAttribute.Name`?
C#CC# / help
3y ago
✅ is it a good disposable class?
C#CC# / help
3y ago
✅ adding SQLite [Indexed] to a C# class property
C#CC# / help
3y ago
❔ Is it a good idea to use a "processed model" in addition to the model bound by ASP.NET itself?
C#CC# / help
3y ago