单项选择题
You are implementing an ASP.NET Web site that will be accessed by an international audience. The site contains global and local resources for display elements that must be translated into the language that is selected by the user. You need to ensure that the Label control named lblCompany displays text in the user’s selected language from the global resource file. Which control markup should you use?()
A.<asp:Label ID="lblCompany" runat="server" meta:resourcekey="lblCompany" />
B.<asp:Label ID="lblCompany" runat="server" Text="meta:lblCompany.Text" />
C.<asp:Label ID="lblCompany" runat="server" Text="<%$ Resources:lblCompanyText %>" />
D.<asp:Label ID="lblCompany" runat="server" Text="<%$ Resources:WebResources, lblCompanyText %>" />
相关考题
-
单项选择题
YouaretestinganexistingASP.NETpage.Thepageincludesatextbox.YouareabletoexecutemaliciousJavaScriptcodebytypingitinthetextboxandsubmitting.YouneedtoconfigurethepagetopreventJavaScriptcodefrombeingsubmittedbythetextbox.Inthe@Pagedirective,whichattributeshouldyousettotrue?()
A.the EnableEventValidation attribute
B.the ResponseEncoding attribute
C.the ValidateRequest attribute
D.the Strict attribute -
单项选择题
You are implementing an ASP.NET MVC 2 Web application that contains the following class. You create a strongly typed view that displays details for a Department instance. You want the view to also include a listing of department employees. You need to write a code segment that will call the ListEmployees action method and output the results in place. Which code segment should you use?()
A.<%= Html.Action("ListEmployees", Model) %>
B.<%= Html.ActionLink("ListEmployees", "Department", "DepartmentController") %>
C.<% Html.RenderPartial("ListEmployees", Model); %>
D.<%= Html.DisplayForModel("ListEmployees") %> -
单项选择题
You create an ASP.NET MVC 2 Web application that contains the following controller class. In the Views folder of your application, you add a view page named Index.aspx that includes the following @ Page directive. You test the application with a browser.You receive the following error message when the Index method is invoked: "The view Index or its master was not found." You need to resolve the error so that the new view is displayed when the Index method is invoked.What should you do?()
A.Change the name of the Index.aspx file to Product.aspx.
B.Create a folder named Product inside the Views folder. Move Index.aspx to the Product folder.
C.Replace the @ Page directive in Index.aspx with the following value.
D.Modify the Index method by changing its signature to the following:public ActionResult Index(Product p)
