Reputation: 9298
I'm trying to create a small app that contains errormessages in database, so they'll be easy to edit etc from a webpage.
So my question is what do I need to put in my class, the "...typeof(MyCustomErrorApp)" to get the current culture? What needs to be derived (?) from etc?
/Lasse
Upvotes: 0
Views: 2943
Reputation: 9052
I assume you are talking about validation attributes - those are loading resources from static class using reflection. You can simply target any class with static properties:
public class DBErrorResources
{
public static string Required
{
get { return DB.FetchErrorMesssage(CultureInfo.CurrentUICulture); }
}
}
Upvotes: 1
Reputation: 1039428
The ASP.NET resource provider is extensible. So you could write your custom ResourceProviderFactory
.
Upvotes: 1