Solved

Contant UI messages in .NET

Posted on 2016-09-08
1
65 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.

830 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