Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 155
  • Last Modified:

Contant UI messages in .NET

Hi

I have some standard UI messages like Error or Info. All are sent from the .Net Web Api service to UI angularjs.

There may be around 5-10 messages for now. This may increase in future.

1> Should I maintain them in the respective Business Class as constants.
2> keep them in Web.Config of the Web api
3> Or Global.asax of the Web api

What is the best practice. If you have any examples i.e helpful also. considering or performance, code maintenance and resusability. There is no database here.

Thanks in Advance
0
Member_2_7967608
Asked:
Member_2_7967608
1 Solution
 
anarki_jimbelCommented:
As I understand these messages are intended for users (customers). In this case I wouldn't maintain these messages hard-coded in business classes. You may need to change them, or you may need to translate them (which is quite common). In this case config file is better, I'd say.

Also check this MS forum: Where to keep an application constant?

Or this one: ASP.NET MVC - Using Resource Files to Manage String Constants

Eventually it depends on your specific needs.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now