PrepAway - Latest Free Exam Questions & Answers

W hich code segment should you add to the action at line 03?

You are developing an ASP.NET MVC application in Visual Studio 2012. The application supports multiple
cultures. The application contains three resource files in the Resources directory:
ProductDictionary.resx
ProductDictionary.es.resx
ProductDictionary.fr.resx
Each file contains a public resource named Currencywith the localized currency symbol. The application is
configured to set the culture based on the client browser settings. The application contains a controller with the
action defined in the following code segment. (Linenumbers are included for reference only.)

You need to set ViewBag.LocalizedCurrency to the localized currency contained in the resource files. W hich
code segment should you add to the action at line 03?

PrepAway - Latest Free Exam Questions & Answers

A.
ViewBag.LocaIizedCurrency = Resources.ProductDictionary.Currency;

B.
VievBag.LocalizedCurrency = HttpContext.GetGlobalResourceObject(“ProductDictionary”, “Currency”, new
System.Globalization.CultureInfo(Men”));

C.
VievBag.LocalizedCurrency = HttpContext.GetLocalResourceObject(“ProductDictionary”, “Currency”);

D.
ViewBag.LocalizedCurrency = HttpContext.GetGlobalResourceObject(“ProductDictionary”, “Currency”);

One Comment on “W hich code segment should you add to the action at line 03?

  1. gfd says:

    Assuming the App_GlobalResources folder, then either A or D. I guess they want ‘A’ as this shows off the VS ability to move global resources into the ‘Resources’ namespace.




    0



    0

Leave a Reply