CSLA .NET

Vibrant discussion about CSLA .NET and using the framework to build great business applications.

Again : Enums as source of NameValueList

rated by 0 users
This post has 2 Replies | 0 Followers

Not Ranked
Posts 13
saeedsamie Posted: Fri, Oct 23 2009 2:12 PM
Hi,

I looked up in the forum and I found a good way for producing a NameValueList based on an Enum type and using [Description("friendly string")] attribute for displaying purposes. But for a multilingual application I need to use resource files for replacing "friendly string" appropriately. The problem is that when I make a reference to the resource file for getting the string I need I recieve a compilation error that says : "An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type ".

Does anybody has a soluton for it?

Not Ranked
Posts 12
sixeyes replied on Fri, Oct 23 2009 2:29 PM
This is what we used:

http://www.codeproject.com/KB/cs/LocalizingEnums.aspx

It's automatic if you're using WinForms but if you're using ASP.NET (we were) you need a couple of lines to force type converters.

Iain
Not Ranked
Posts 13
Hi Iain,

 It was very helpful.

Thanks
Page 1 of 1 (3 items) | RSS

Copyright (c) 2006-2010 Marimer LLC. All rights reserved.
Email admin@lhotka.net for support.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems