right now I am typing out my messages in the controllers I use like this:
TempData["flashError"] = "There Was A Problem Updating Your Account, Please Try Again";
I would like to reference a key/value system such as:
TempData["flashError"] = Messages["accountProblem"];
Is there a certain way to do this so I can maintain my messages from a separate file? Can someone tell me best practice?
You may take a look at the following guide. You’d basically externalize the messages into resource files for each language and then you could use the strongly typed class that is automatically generated by Visual Studio to access those strings in your code.