单项选择题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?()

A.Replace line 11 with the following code segment. context.MapRoute("product_default",   "{area}/{controller}/{action}/{id}", New With {.area = "product", .controller = "Product",   .action = "Index", .id = ""})
B.Replace line 11 with the following code segment. context.MapRoute("product_default",   "{area}", New With {.controller = "Product", .action = "Index", .id = ""})
C.Add the following code segment at line 12.  AreaRegistration.RegisterAllAreas()
D.Add the following code segment to the RegisterRoutes method in the Global.asax.vb file.   AreaRegistration.RegisterAllAreas()


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

You are creating an ASP.NET Web site. You create a HTTP module named Custom Module, and you register the module in the web.config file.The Custom Module class contains the following code. Public Class Custom Module  Implements IHttpModule    
Dim footerContent As String = Footer Content"Public Sub Dispose() Implements IHttpModule.DisposeEnd SubEnd Class  You need to add code to CustomModule to append the footer content to each processed ASP.NET page. Which code segment should you use?()

A.Public Sub New(ByVal app As HttpApplication) AddHandler app.EndRequest, AddressOf app_EndRequest  End Sub  Sub app_EndRequest(ByVal sender As Object, ByVal e As EventArgs)    Dim app As HttpApplication = TryCast(sender, HttpApplication)  app.Response.Write(footerContent)  End Sub 
B.Public Sub Init(ByVal app As HttpApplication) _  Implements IHttpModule.Init  AddHandler app.EndRequest, AddressOf app_EndRequest  End Sub Sub app_EndRequest(ByVal sender As Object, ByVal e As EventArgs)  Dim app As HttpApplication = New HttpApplication()  app.Response.Write(footerContent)  End Sub 
C.Public Sub New()  Dim app As HttpApplication = New HttpApplication()  AddHandler app.EndRequest, AddressOf app_EndRequest End Sub  Sub app_EndRequest(ByVal sender As Object, ByVal e As EventArgs)  Dim app As HttpApplication = TryCast(sender, HttpApplication)  app.Response.Write(footerContent)  End Sub 
D.Public Sub Init(ByVal app As HttpApplication) _  Implements IHttpModule.Init  AddHandler app.EndRequest, AddressOf app_EndRequest  End Sub  Sub app_EndRequest(ByVal sender As Object, ByVal e As EventArgs)  Dim app As HttpApplication = TryCast(sender, HttpApplication)app.Response.Write(footerContent)  End Sub

2.多项选择题You are implementing an ASP.NET Web application. Users will authenticate to the application with an ID. The application will allow new users to register for an account. The application will generate an ID for the user based on the users full name. You need to implement this registration functionality. Which two actions should you perform?()

A.Configure the SqlMembershipProvider in the web.config file.
B.Configure the SqlProfileProvider in the web.config file.
C.Create an ASP.NET page that contains a default CreateUserWizard control to create a new user account.
D.Create an ASP.NET page that contains a custom form that collects the user information and then uses the Membership.CreateUser method to create a new user account.

3.多项选择题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?()

A.Add the following method to the CompanyController class. Function Info() As ActionResult   Return View() End Function
B.Add the following method to the CompanyController class. Function Company_Info() As ActionResult  Return View() End Function
C.Right-click the Views folder, and select View from the Add submenu to create the view for the action.
D.Right-click inside the action method in the CompanyController class, and select Add View to create a view for the action

8.单项选择题You are implementing an ASP.NET application that includes a page named TestPage.aspx. TestPage.aspx uses a master page named TestMaster.master.You add the following code to the TestPage.aspx code-behind file to read a TestMaster.master public property named CityName. Protected Sub Page_Load(ByVal sender As Object,ByVal e As System.EventArgs) Handles Me.LoadDim s As String = Master.CityNameEnd Sub  You need to ensure that TestPage.aspx can access the CityName property. What should you do?()

A.Add the following directive to TestPage.aspx. <%@ MasterType VirtualPath="~/TestMaster.master" %> 
B.Add the following directive to TestPage.aspx. <%@ PreviousPageType VirtualPath="~/TestMaster.master" %> 
C.Set the Strict attribute in the @ Master directive of the TestMaster.master page to true. 
D.Set the Explicit attribute in the @ Master directive of the TestMaster.master page to true. 

9.单项选择题You are troubleshooting an ASP.NET Web application. System administrators have recently expanded your web farm from one to two servers. Users are periodically reporting an error message about invalid view state. You need to fix the problem. What should you do?()

A.Set viewStateEncryptionMode to Auto in web.config on both servers.
B.Set the machineKey in machine.config to the same value on both servers.
C.Change the session state mode to SQLServer on both servers and ensure both servers use the same connection string.
D.Override the SavePageStateToPersistenceMedium and LoadPageStateFromPersistenceMedium methods in the page base class to serialize the view state to a local web server file.

最新试题

You are developing an ASP.NET Web application.The application is configured to use the membership and role providers. You need to allow all users to perform an HTTP GET for application resources, but you must allow only the user named Moderator to perform a POST operation.Which configuration should you add to the web.config file?()

题型:单项选择题

Which class provides paging functionality for data-bound controls that implement the IPageableItemContainer interface?()

题型:单项选择题

You are developing an ASP.NET Web page that uses jQuery validation. The user should enter a valid email address in a text box that has ID txtEmail. The page must display "E-Mail address required" when the user does not enter an address and "Invalid e-mailaddress" when the user enters an address that is not formatted properly. You need to ensure that the appropriate error message is displayed when the text box does not contain a valid e-mail address.  Which two code segments should you add?()

题型:多项选择题

You need to ensure that when the button is clicked, both update panels update the tim without generating a postback.  What should you do?()

题型:单项选择题

Which tool is used to simplify the migration, management and deployment of IIS Web servers, Web applications and Web sites?()

题型:单项选择题

You are debugging an ASP.NET Web application by using the Visual Studio debugger. The application is incorrectly handling a SQL Exception on the login page. You need to break execution where the exception is thrown . What should you do?()

题型:单项选择题

Which class defines the contract that ASP.NET implements to provide membership services using custom membership providers?()

题型:单项选择题

You are developing an ASP.NET MVC 2 Web Application. You need to implement an asynchronous controller named AccountingController, and you must ensure that the export action required proper authorization.Which code segment should you use?()

题型:单项选择题

Which method of the Page class searches the page naming container for a server control with a particular identifer?()

题型:单项选择题

Which method of the ChildActionExtensions class calls a child action method and renders the result inline in the parent view?()

题型:单项选择题