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

A.Add the following code segment to the Page_Load metho……

You are creating an ASP.NET Web site. 
The site has a master page named Custom.master. 
The code-behind file for Custom.master contains the following code segment. 
You create a new ASP.NET page and specify Custom.master as its master page. You add a Label control named lblRegion to the new page. 
You need to display the value of the master page’s Region property in lblRegion. What should you do? ()



A.Add the following code segment to the Page_Load method of the page code-behind file. CustomMaster custom = this.Parent as CustomMaster; lblRegion.Text = custom.Region;
B.Add the following code segment to the Page_Load method of the page code-behind file. CustomMaster custom = this.Master as CustomMaster; lblRegion.Text = custom.Region;
C.Add the following code segment to the Page_Load method of the Custom.Master.cs code-behind file. Label lblRegion = Page.FindControl("lblRegion") as Label; lblRegion.Text = this.Region;
D.Add the following code segment to the Page_Load method of the Custom.Master.cs code-behind file. Label lblRegion = Master.FindControl("lblRegion") as Label; lblRegion.Text = this.Region;

热门试题

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

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