Solved

Contant UI messages in .NET

Posted on 2016-09-08
1
40 Views
Last Modified: 2016-10-21
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
Comment
Question by:Member_2_7967608
1 Comment
 
LVL 29

Accepted Solution

by:
anarki_jimbel earned 500 total points
ID: 41793693
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now