单选题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.MapRou

题目
单选题
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?()
A

Replace line 05 with the following code segment. routes.MapRoute( "Default", "{controller}/{action}/{id}", New With {.controller = "Home", .action = "DetailsByUsername", .id = ""})

B

Replace line 05 with the following code segment. routes.MapRoute("Default", "{controller}/{action}/{username}", New With {.controller = "Home", .action = "DetailsByUsername", .username = ""}, New With {.username = "/w{3,20}"} )

C

At line 04, add the following code segment.routes.MapRoute( "Details byUsername""{username}", New With {.controller = "Home", .action = "DetailsByUsername"}, New With {.username = "/w{3,20}"})

D

At line 04, add the following code segment. routes.MapRoute( "Details by Username", "{id}",  New With {.controller = "Home", .action = "DetailsByUsername"}, New With {.id = "/w{3,20}"} )


相似考题
更多“You create a new ASP.NET MVC 2 Web application. The followin”相关问题
  • 第1题:

    You are developing an ASP.NET Web application. You create a master page. The master page requires a region where you can add page-specific content by using the ASP.NET page designer.  You need to add a control to the master page to define the region. Which control should you add?()

    • A、Content
    • B、ContentPlaceHolder
    • C、PlaceHolder
    • D、Substitution

    正确答案:B

  • 第2题:

    You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.  When you access the application in a Web browser, you receive the following error message: "Service Unavailable".  You need to access the application successfully.  What should you do? ()

    • A、Start Microsoft IIS 6.0.
    • B、Start the Application pool.
    • C、Set the .NET Framework version.
    • D、Add the Web.config file for the application.

    正确答案:B

  • 第3题:

    You work as an ASP.NET Web Application Developer for SomeCompany.  The company uses Visual Studio .NET 2010 as its application development platform. You create an ASP.NET Web application using .NET Framework 4.0. You create a Web page in the application. The Web page will get large sets of data from a data source.  You add a DataPager control to the page. You are required to display navigation controls that enable you to create a custom paging Ul for the DataPager control. What will you do?()

    • A、Use NextPreviousPagerField.
    • B、Use NumericPagerField.
    • C、Use PreviousPagerField.
    • D、Use NextPagerField.
    • E、Use TemplatePagerField.

    正确答案:E

  • 第4题:

    You create a Visual Studio 2010 solution that includes a WCF service project and an ASP.NET project. The service includes a method named GetPeople that takes no arguments and returns an array of Person objects. The ASP.NET application uses a proxy class to access the service. You use the Add Service Reference wizard to generate the class. After you create the proxy, you move the service endpoint to a different port. You need to configure the client to use the new service address. In addition, you must change the implementation so that calls to the client proxy will return a List instead of an array. Which two actions should you perform?()

    • A、In the context menu for the service reference in the ASP.NET project, select the Configure Service Reference commSystem.Collections.Generic.List
    • B、In the context menu for the service reference in the ASP.NET project, select the Update Service Reference comma
    • C、Change the service interface and implementation to return a List
    • D、Edit the address property of the endpoint element in the web.config file to use the new service address

    正确答案:A,D

  • 第5题:

    单选题
    You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You plan to deploy the application to a test server.  You need to ensure that during the initial request to the application, the code-behind files for the Web pages are compiled. You also need to optimize the performance of the application.  Which code fragment should you add to the Web.config file?()
    A

    <compilation debug=true> 

    B

    <compilation debug=false> 

    C

    <compilation debug=true batch=true> 

    D

    <compilation debug=false batch=false>


    正确答案: B
    解析: 暂无解析

  • 第6题:

    单选题
    You are developing an ASP.NET MVC 2 Web application. The application contains a controller named HomeController, which has an action named Index. The application also contains a separate area named Blog. A view within the Blog area must contain an ActionLink that will link to the Index action of the HomeController. You need to ensure that the ActionLink in the Blog area links to the Index action of the HomeController. Which ActionLink should you use?()
    A

    Html.ActionLink(Home, Index, Home)

    B

    Html.ActionLink(Home, Index, Home, new {area = }, null)

    C

    Html.ActionLink(Home, Index, Home, new {area = Blog}, null)

    D

    Html.ActionLink(Home, Index, Home, new {area = Home}, null)


    正确答案: A
    解析: 暂无解析

  • 第7题:

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

    Master

    B

    Default

    C

    Shared

    D

    Common


    正确答案: A
    解析: 暂无解析

  • 第8题:

    单选题
    You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.  You use Windows Authentication for the application. You set up NTFS file system permissions for the Sales group to access a particular file. You discover that all the users are able to access the file.  You need to ensure that only the Sales group users can access the file. What additional step should you perform?()
    A

    Remove the rights from the ASP.NET user to the file. 

    B

    Remove the rights from the application pool identity to the file. 

    C

    Add the <identity impersonate=true/> section to the Web.config file. 

    D

    Add the <authentication mode=[None]> section to the Web.config file.


    正确答案: B
    解析: 暂无解析

  • 第9题:

    单选题
    You modify an existing Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.  You add a theme to the ASP.NET application.  You need to apply the theme to override any settings of individual controls.  What should you do?()
    A

    In the Web.config file of the application,set the Theme attribute of the pages element to the name of the theme.

    B

    In the Web.config file of the application,set the StyleSheetThemeattribute of the pages element to the name of the theme.

    C

    Add a master page to the application. In the @Master directive,set the Theme attribute to the name of the theme.

    D

    Add a master page to the application. In the @Master directive,set the StyleSheetTheme attribute to the name of the theme.


    正确答案: B
    解析: 暂无解析

  • 第10题:

    单选题
    You work as the IT professional in an international company which is named Wiikigo. You are experiencedin implementing and administering a network operating system. You are specialized in deploying servers,configuring Windows Server 2008 Terminal services and network application services, and configuring aweb services infrastructure. You are in charge of a server that runs Windows Server 2008. The server hasthe Web Server (IIS) server role installed. The Web developer at your company creates a new Web sitethat runs an ASP.NET 3.0 Web application. The ASP.NET Web application must run under a securitycontext that is separate from any other ASP.NET application on the Web server. You create a local useraccount and grant account rights and permissions to run the ASP.NET Web application. Authentication forthe new Web site should be configured to support the Web application. What action should you perform?()
    A

    The ASP.NET Impersonation setting should be configured to Enabled. Edit the ASP.NET Impersonation setting by specifying the new local user account.

    B

    The Windows Authentication setting should be configured to Enabled.

    C

    The Forms Authentication setting should be configured to Enabled by using all the default settings.

    D

    The ASP.NET State Service should be configured to log on to the new local user account by using the Services console.


    正确答案: B
    解析: 暂无解析

  • 第11题:

    多选题
    You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.  When you review the application performance counters, you discover that there is an unexpected increase in the value of the Application Restarts counter. You need to identify the reasons for this increase.  What are three possible reasons that could cause this increase?()
    A

    Restart of the Microsoft IIS 6.0 host.

    B

    Restart of the Microsoft Windows Server 2003 that hosts the Web application.

    C

    Addition of a new assembly in the Bin directory of the application.

    D

    Addition of a code segment that requires recompilation to the ASP.NET Web application.

    E

    Enabling of HTTP compression in the Microsoft IIS 6.0 manager for the application.

    F

    Modification to the Web.config file in the <system.web> section for debugging the application.


    正确答案: E,F
    解析: 暂无解析

  • 第12题:

    You need to design a domain model that meets the company business and security requirements for controlling access to the new Web-based ordering application. What should you do?()

    • A、Create a child OU within the existing domain
    • B、Create a child domain of the existing domain
    • C、Create a new domain in a new forest. Configure the new domain to trust the existing domain
    • D、Create a new tree in the existing forest. Configure the new domain to trust the existing domain

    正确答案:C

  • 第13题:

    You are developing an ASP.NET Web application. You create a master page. The master page requires a region where you can add page-specific content by using theASP.NET page designer. You need to add a control to the master page to define the region. Which control should you add?()

    • A、PlaceHolder
    • B、ContentPlaceHolder
    • C、Content
    • D、Substituition

    正确答案:B

  • 第14题:

    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?()

    • A、Add the ValidateAntiForgeryToken attribute to the Details action method.
    • B、Add the Bind attribute to the country parameter of the Details action method. Set the attribute’s Prefix property to Country.
    • C、Create a class that implements the IRouteConstraint interface. Configure the default route to use this class.
    • D、Create a class that implements the IRouteHandler interface. Configure the default route to use this class.

    正确答案:C

  • 第15题:

    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.

    正确答案:A,D

  • 第16题:

    多选题
    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.


    正确答案: B,D
    解析: 暂无解析

  • 第17题:

    单选题
    You are developing an ASP.NET MVC 2 Web application. The application contains a controller named Home Controller, which has an action named Index. The application also contains a separate area named Blog. A view within the Blog area must contain an Action Link that will link to the Index action of the Home Controller. You need to ensure that the Action Link in the Blog area links to the Index action of the HomeController. Which Action Link should you use?()
    A

    Html.ActionLink(Home, Index, Home)

    B

    Html.ActionLink(Home, Index, Home,  New With {.area = }, Nothing)

    C

    Html.ActionLink(Home, Index, Home,  New With {.area = Blog}, Nothing)

    D

    Html.ActionLink(Home, Index, Home,  New With {.area = Home}, Nothing)


    正确答案: B
    解析: 暂无解析

  • 第18题:

    单选题
    You manage a server that runs Windows Server 2008. The server has the Web Server (IIS) role installed. The Web developer at your company creates a new Web site that runs an ASP.NET 3.0 Web application.  The ASP.NET Web application must run under a security context that is separate from any other ASP.NET application on the Web server.  You create a local user account and grant account rights and permissions to run the ASP.NET Web application.  You need to configure authentication for the new Web site to support the Web application. What should you do?()
    A

    Configure the Windows Authentication setting to Enabled.

    B

    Configure the Forms Authentication setting to Enabled by using all the default settings.

    C

    Configure the ASP.NET State service to log on to the new local user account by using the Services console.

    D

    Configure the ASP.NET Impersonation setting to Enabled. Edit the ASP.NET Impersonation setting by specifying the new local user account.


    正确答案: A
    解析: 暂无解析

  • 第19题:

    单选题
    You are employed as the senior administrator at Certkiller.com. You make use of Microsoft .NETFramework v3.5 to create a Microsoft ASP.NET application.  You make use of ASP.NET AJAX create a Web form. The code fragment below exists in the Webfrom. (The line numbers is included for reference purposes) 01  10 11  13   You make use of the initComponents function to create and start a user behavior. This userbehavior is named CKBehavior. You have to make sure that CKBehavior is attached to CKTextBoxA. You should determine the appropriate code segment you need to add in line 6 toaccomplish this.  What should you identify?()
    A

    Your best option would be to insert Sys.Component.create(CKBehavior, $get('CKTextBoxA'),null, null, null)

    B

    Your best option would be to insert Sys.Component.create(CKBehavior, 'CKTextBoxA', null,null, null)

    C

    Your best option would be to insert $create(CKBehavior, null, null, null, $get('CKTextBoxA'))

    D

    Your best option would be to insert $create(CKBehavior, null, null, null, 'CKTextBoxA')


    正确答案: B
    解析: 暂无解析

  • 第20题:

    单选题
    You work as an ASP.NET Web Application Developer for SomeCompany. The company uses Visual Studio .NET 2010 as its application development platform. You create an ASP.NET MVC 2 Web application using .NET Framework 4.0. You implement a single project area in the MVC 2 Web application. In the Areas folder, you add a subfolder named MyTest. You add the following files to the appropriate sub-folders:  MyController. csMyHome.aspx  You register a route of the area, setting the route name to MyTest_default and the area name to test. You create a view named MyViews.aspx that is outside the test area. You need to add a link to MyViews.aspx that points to MyHome.aspx. Which of the following code segments will you use?()
    A

    <%= Html.ActionLink(MyTest, MyHome, new {area = test}, null)%>

    B

    <%= Html.RouteLink(MyHome, MyTest, new {area = test}, null)%> 

    C

    <%= Html.RouteLink(MyTest, MyHome, MyTest, new {area = test}, null)%>

    D

    <%= Html.ActionLink(MyTest, MyHome, MyTest, new {area = test}, null)%>


    正确答案: B
    解析: 暂无解析

  • 第21题:

    单选题
    You are developing an ASP.NET MVC 2 Web application. A page makes an AJAX request and expects a list of company names in the following format. ["Adventure Works","Contoso"] You need to write an action method that returns the response in the correct format. Which type should you return from the action method?()
    A

    AjaxHelper

    B

    XDocument

    C

    JsonResult

    D

    DataContractJsonSerializer


    正确答案: B
    解析: 暂无解析