You are implementing an ASP.NET MVC 2 Web application. The URL with path /Home/Details/{country} will return a page that provides information about the named country. You need to ensure that requests for this URL that contain an unrecognized country value will not be processed by the Details action of HomeController. What should you do?()
MVC中的MVC分别用()、()、()表示。
You are implementing an ASP.NET MVC 2 Web application. A controller contains the following code. The first Edit action displays the user whose details are to be edited, and the second Edit action is called when the Save button on the editing form is clicked to update the user details. An exception is thrown at run time stating that the request for action Edit is ambiguous. You need to correct this error and ensure that the controller functions as expected.What are two possible ways to achieve this goal?()
在一个典型的基于MVC(Model-View-Controller)的J2EE应用中,分发客户请求、有效组织其他构件为客户端提供服务的控制器由()实现。
ou are developing an ASP.NET MVC 2 application. You create a view that will be returned by action methods in multiple controllers. You need to place the view in the appropriate folder. To which subfolder within the Views folder should you add the view?()
You are implementing an ASP.NET MVC 2 application. In the Areas folder, you add a subfolder named Product to create a single project areA. You add files named ProductController.vb and Index.aspx to the appropriate subfolders. You then add a file named Route.vb to the Product folder that contains the following code.01 Public Class Route Inherits AreaRegistration02 03 Public Overrides ReadOnly Property AreaName As String04 Get 05 Return "product"06 End Get 07 End Property08 09 Public Overrides Sub RegisterArea(ByVal context As AreaRegistrationContext)10 11 context.MapRoute("product_default", "product/{controller}/{action}/{id}", New With {.controller = "Product", .action = "Index",.id = ""})12 13 End Sub End Class When you load the URL http:///product, you discover that the correct page is not returned. You need to ensure that the correct page is returned. What should you do?()
You create a new ASP.NET MVC 2 Web application. The following default routes are created in the Global.asax.vb file.01 Shared Sub RegisterRoutes(ByVal routes As RouteCollection)02 03 routes.IgnoreRoute("{resource}.axd/{*pathInfo}")04 05 routes.MapRoute( "Default", "{controller}/{action}/{id}", New With {.controller = "Home", .action = "Index", .id = ""}) 06 End Sub You implement a controller named HomeController that includes methods with the following signatures.Function Index() As ActionResult Function Details(ByVal id As Integer) As ActionResultFunction DetailsByUsername( ByVal username As String) As ActionResult You need to add a route to meet the following requirements. The details for a user must be displayed when a user name is entered as the path by invoking the DetailsByUsername action. User names can contain alphanumeric characters and underscores, and can be between 3 and 20 characters long.What should you do?()
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?()
You are implementing an ASP. NET MVC 2 Web application. You add a controller named Company Controller. You need to modify the application to handle the URL path /company/info. Which two actions should you perform?()
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?()