Câu 34: 70-486: MCSD Developing ASP.NET MVC 4 Web Applications
You are developing an ASP. NET MVC application in Visual Studio. The application supports multiple cultures. The application contains three resource files in the Resources directory: ✑ MyDictionary.resx ✑ MyDictionary.es.resxMyDictionary.fr.resx - Each file contains a public resource named Title with localized transla…
Nội dung câu hỏi
You are developing an ASP. NET MVC application in Visual Studio. The application supports multiple cultures. The application contains three resource files in the Resources directory: ✑ MyDictionary.resx ✑ MyDictionary.es.resxMyDictionary.fr.resx - Each file contains a public resource named Title with localized translation. 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.) You need to set ViewBag. Title to the localized title contained in the resource files. Which code segment should you add to the action at line 03?
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
- A. ViewBag.Title = HttpContext.GetGlobalResourceObject("MyDictionary", "Title");
- B. ViewBag.Title = HttpContext.GetGlobalResourceObject("MyDictionary", "Title", new System.Globalization.CultureInfo("en"));
- C. ViewBag.Title = Resources.MyDictionary.Title; — đáp án hiện tại
- D. ViewBag.Title = HttpContext.GetLocalResourceObject("MyDictionary", "Title");
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.