找考题网-背景图
单项选择题

A.protected void SelectedLanguageChanged(object sender,……

You are implementing an ASP.NET Web site. 
The site allows users to explicitly choose the display language for the site's Web pages. You create a Web page that contains a DropDownList named ddlLanguage, as shown in the following code segment.

The site contains localized resources for all page content that must be translated into the language that is selected by the user. You need to add code to ensure that the page displays content in the selected language if the user selects a language in the drop-down list. Which code segment should you use?()



A.protected void SelectedLanguageChanged(object sender, EventArgs e) {Page.UICulture = ddlLanguage.SelectedValue;}
B.protected override void InitializeCulture() {Page.UICulture = Request.Form["ddlLanguage"];}
C.protected void Page_Load(object sender, EventArgs e) {Page.Culture = Request.Form["ddlLanguage"];}
D.protected override void InitializeCulture() {Page.Culture = ddlLanguage.SelectedValue;}

热门试题

单项选择题YoucreateanewASP.NETMVC2Webapplication.ThefollowingdefaultroutesarecreatedintheGlobal.asax.vbfile.01SharedSubRegisterRoutes(ByValroutesAsRouteCollection)0203routes.IgnoreRoute( {resource}.axd {*pathInfo} )0405routes.MapRoute( Default , {controller} {action} {id} ,NewWith{.controller= Home ,.action= Index ,.id= })06EndSubYouimplementacontrollernamedHomeControllerthatincludesmethodswiththefollowingsignatures.FunctionIndex()AsActionResultFunctionDetails(ByValidAsInteger)AsActionResultFunctionDetailsByUsername(ByValusernameAsString)AsActionResultYouneedtoaddaroutetomeetthefollowingrequirements.ThedetailsforausermustbedisplayedwhenausernameisenteredasthepathbyinvokingtheDetailsByUsernameaction.Usernamescancontainalphanumericcharactersandunderscores,andcanbebetween3and20characterslong.Whatshouldyoudo?()

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}"} )

单项选择题YouareimplementinganASP.NETMVC2application.IntheAreasfolder,youaddasubfoldernamedProducttocreateasingleprojectareA.YouaddfilesnamedProductController.vbandIndex.aspxtotheappropriatesubfolders.YouthenaddafilenamedRoute.vbtotheProductfolderthatcontainsthefollowingcode.01PublicClassRouteInheritsAreaRegistration0203PublicOverridesReadOnlyPropertyAreaNameAsString04Get05Return product 06EndGet07EndProperty0809PublicOverridesSubRegisterArea(ByValcontextAsAreaRegistrationContext)1011context.MapRoute( product_default , product {controller} {action} {id} ,NewWith{.controller= Product ,.action= Index ,.id= })1213EndSubEndClassWhenyouloadtheURLhttp: product,youdiscoverthatthecorrectpageisnotreturned.Youneedtoensurethatthecorrectpageisreturned.Whatshouldyoudo?()

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