Question 40


70-486 Skills Measured >> 3.2 Plan and implement globalization and localization >>

Question:

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 Currency with 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. (Line numbers are included for reference only.)
01
02
03
04
05
06
public ActionResult GetProducts()
{

List<ProductModel> products = DataBase.DBAccess.GetProducts();
return View(Products);
}
You need to set ViewBag.LocalizedCurrency to the localized currency contained in the resource files. Which code segment should you add to the action at line 03?

  • 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");

Answer:

A