网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

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.Partial Public Class Custom  Inherits System.Web.UI.MasterPagePublic Property Region As String    Protected Sub Page_Load(ByVal sender As Object,ByVal e As System.EventArgs) Handles Me.LoadEnd SubEnd Class 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 pages 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. Dim custom As Custom = Me.Parent  lblRegion.Text = custom.Region
  • B、Add the following code segment to the Page_Load method of the page code-behind file. Dim custom As Custom = Me.Master  lblRegion.Text = custom.Region
  • C、Add the following code segment to the Page_Load method of the Custom.Master.vb code-behind file. Dim lblRegion As Label = Page.FindControl("lblRegion") lblRegion.Text = Me.Region
  • D、Add the following code segment to the Page_Load method of the Custom.Master.vb code-behind file. Dim lblRegion As Label = Master.FindControl("lblRegion") lblRegion.Text = Me.Region

参考答案

更多 “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.Partial Public Class Custom  Inherits System.Web.UI.MasterPagePublic Property Region As String    Protected Sub Page_Load(ByVal sender As Object,ByVal e As System.EventArgs) Handles Me.LoadEnd SubEnd Class 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 pages 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. Dim custom As Custom = Me.Parent  lblRegion.Text = custom.RegionB、Add the following code segment to the Page_Load method of the page code-behind file. Dim custom As Custom = Me.Master  lblRegion.Text = custom.RegionC、Add the following code segment to the Page_Load method of the Custom.Master.vb code-behind file. Dim lblRegion As Label = Page.FindControl("lblRegion") lblRegion.Text = Me.RegionD、Add the following code segment to the Page_Load method of the Custom.Master.vb code-behind file. Dim lblRegion As Label = Master.FindControl("lblRegion") lblRegion.Text = Me.Region” 相关考题
考题 You create a master page named PageBase.master. The master page contains a Label control named lblTitle.You create a content page that references the master page.You need to change the Text property of the master page‘s lblTitle control from the content page.Which code segment should you use?()A.B.C.D.

考题 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 void Page_Load(object sender, EventArgs e) { string s = Master.CityName; }  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" %%@ mastertype="" virtualpath="~/TestMaster.master"B、Add the following directive to TestPage.aspx. %@ PreviousPageType VirtualPath="~/TestMaster.master" %%@ 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.

考题 You have a master page custom.master ... u create a nested.master page using it ... and then u have content page that uses the nested.master as its master page ...  to get a string prop from custom.master into a label in content page the code u wud use()A、master.masterB、parent.masterC、this.masterD、unknown

考题 You create a master page named Article.master. Article.master serves as the template for articles on your Web site. The master page uses the following page directives. %@ Master Language="VB" CodeFile="article.master.vb" Inherits="article" % You need to create a content page that uses the master page as a template. In addition, you need to use a single master page for all devices that access the Web site. Which code segment should you use? ()A、%@ Page Language="VB" Theme="article"%B、%@ Page Language="VB" MasterPageFile="~/article.master"%C、%@ Page Language="VB" ie:MasterPageFile="~/article.master"%D、%@Page Language="VB" all:MasterPageFile="~/article.master"%

考题 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. 

考题 You are developing a Web application to display products. Products are displayed on different pages on your Web site. You want to create a user control to manage the display of products. You need a default visual implementation of the UI of the user control. In addition, you need to provide developers with the flexibility to change the layout and controls of the UI. Which three actions should you perform? ()A、Apply the TemplateContainerAttribute to a property of type ITemplate. Pass the type of the template's naming container as the argument to the attribute.B、Apply the TemplateContainerAttribute to the user control's class declaration.C、Implement a property of type INamingContainer in the user control's code-behind class.D、Implement a property of type ITemplate in the user control's code-behind class.E、Define a new class that inherits from the ITemplate interface. Implement the InstantiateIn method of the ITemplate interface.

考题 You are creating a custom user control. The custom user control will be used on 10 Web Forms for an ASP.NET Web site that allows users to register and log on to a personalized experience. The custom user control uses two TextBox controls and two Button controls. You need to ensure that the controls are visible only when users are not logged on to the Web site. You also need to minimize the amount of effort in development and maintenance for the Web site. Which two actions should you perform? ()A、Add the OnClick event handler for the Login button to the code used in the custom user control.B、Add the OnClick event handler for the Login button to the code used in the Web Form where the control is added.C、In the Page_Load method of the Web Form, add a code segment to set the visibility of the TextBox and Button controls where the control is added.D、In the Page_Load method of the custom user control, add a code segment to set the visibility of the TextBox and Button controls.

考题 You are creating a custom user control. The custom user control will be used on 10 Web Forms for an ASP.NET Web site that allows users to register and log on to a personalized experience.The custom user control uses two TextBox controls and two Button controls.You need to ensure that the controls are visible only when users are not logged on to the Web site. You also need to minimize the amount of effort in development and maintenance for the Web site. Which two actions should you perform?()A、Add the OnClick event handler for the Login button to the code used in the custom user control.B、Add the OnClick event handler for the Login button to the code used in the Web Form where the control is added.C、In the Page_Load method of the Web Form, add a code segment to set the visibility of the TextBox and Button controls where the control is added.D、In the Page_Load method of the custom user control, add a code segment to set the visibility of the TextBox and Button controls.

考题 You create a Web page named TestPage.aspx and a user control named TestUserControl.ascx. TestPage.aspx uses TestUserControl.ascx as shown in the following line of code. On TestUserControl.ascx, you need to add a read-only member named CityName to return the value "New York". You also must add code to TestPage.aspx to read this value. Which two actions should you perform?()A、Add the following line of code to the TestUserControl.ascx.cs code-behind file. public string CityName { get { return "New York"; } } B、Add the following line of code to the TestUserControl.ascx.cs code-behind file. protected readonly string CityName = "New York"; C、Add the following code segment to the TestPage.aspx.cs code-behind file. protected void Page_Load(object sender, EventArgs e) { string s = testControl.CityName; } D、Add the following code segment to the TestPage.aspx.cs code-behind file. protected void Page_Load(object sender, EventArgs e) { string s = testControl.Attributes["CityName"]; } 

考题 You are developing an ASP.NET Web page. The page includes a List instance. You add a FormView control to display a single Product from this list. You need to bind the list to the FormView control. Which FormView property should you set in the code-behind file?()A、DataSourceB、DataSourceIDC、DataKeyNamesD、DataMember

考题 You work as a Web Developer at Certkiller.com. You make use of Microsoft ASP.NET 3.5 in orderto create a Web Site.  In a separate code file you create the following class:  public static class _Colors {  public static Color NormalActivityColor = Color.Green;  public static Color WarningActivityColor = Color.Yellow;  public static Color ErrorActivityColor = Color.Red;    public static Color GetRandomColor()  {  Random random = new Random((int)DateTime.Now.Ticks);  int randomArgbValue = random.Next();  Color color = Color.FromArgb(255, Color.FromArgb(randomArgbValue));  return color;  }  }  You need to ensure that the class is consumed by the Web Site. You have to configure the WebSite project.  What should you do?()A、You should add the file to the App_Code folder of the project.B、You should add a Register directive that will reference the file to every page that makes use ofthe class.C、This can be accomplished by referencing the file in the assemblies segment of the Web.configfile.D、This can be accomplished by referencing the file in the httpHandlers segment of the Web.configfile.

考题 You are implementing an ASP.NET MVC 2 Web application that contains several folders. The Views/Shared/DisplayTemplates folder contains a templated helper named Score.ascx that performs custom formatting of integer values.  The Models folder contains a class named Player with the following definition.Public Class Player   Public Property Name As String   Public Property LastScore As IntegerPublic Property HighScore As IntegerEnd Class  You need to ensure that the custom formatting is applied to LastScore values when the HtmlHelper.DisplayForModel method is called for any view in the application that has a model of type Player. What should you do?()A、Rename Score.ascx to LastScore.ascx.B、Move Score.ascx from the Views/Shared/DisplayTemplates folder to the Views/Player/DisplayTemplates folder.C、Add the following attribute to the LastScore property. UIHint("Score")D、Add the following attribute to the LastScore property. Display(Name:="LastScore", ShortName:="Score")

考题 You create a master page named Article.master. Article.master serves as the template for articles on your Web site. The master page uses the following page directives. %@ Master Language="C#" Src="~/article.master.cs" Inherits="article" % You need to create a content page that uses the master page as a template. In addition, you need to use a single master page for all devices that access the Web site. Which code segment should you use? ()A、%@ Page Language="C#" Theme="article"%B、%@ Page Language="C#" MasterPageFile="~/article.master"%C、%@ Page Language="C#" ie:MasterPageFile="~/article.master"%D、 %@Page Language="C#" all:MasterPageFile="~/article.master"%

考题 You create a Web Form. The Web Form allows users to log on to a Web site. You implement the login logic using a Login control named Login1. The membership data for the application is stored in a SQL Express database in the App_Data directory. You need to configure your application so that the membership data is stored in a local Microsoft SQL Server database. You add the following code segment to the Web.config file. Which two additional actions should you perform?()A、Use Aspnet_regsql.exe to create the Microsoft SQL Server database.B、Set Login1's MembershipProvider property to MySqlProviderConnection.C、Add the following code segment to the Web.config file.connectionStrings add name="MySqlProviderConnection" connectionString="valid connection string" //connectionStringsD、Add the following code segment to the Web.config file.appSettingsadd key="MySqlProviderConnection" value="valid connection string" //appSettingsE、In the ASP.NET configuration settings within IIS, ensure that Role Management Enabled is selected.F、Use the Web Site Administration Tool to select AspNetSqlMembershipProvider as the membership provider for your application.

考题 You use the following declaration to add a Web user control named TestUserControl.ascx to an ASP.NET page named TestPage.aspx.    You add the following code to the code-behind file of TestPage.aspx.  private void TestMethod(){ ...}You define the following delegate.  public delegate void MyEventHandler();  You need to add an event of type MyEventHandler named MyEvent to TestUserControl.ascx and attach the page’s TestMethod method to the event. Which two actions should you perform?()A、Add the following line of code to TestUserControl.ascx.cs. public event MyEventHandler MyEvent;B、Add the following line of code to TestUserControl.ascx.cs. public MyEventHandler MyEvent;C、Replace the TestUserControl.ascx reference in TestPage.aspx with the following declaration. uc:TestUserControl ID="testControl" runat="server" OnMyEvent="TestMethod"/D、Replace the TestUserControl.ascx reference in TestPage.aspx with the following declaration. uc:TestUserControl ID="testControl" runat="server" MyEvent="TestMethod"/

考题 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

考题 You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a custom Web user control named SharedControl. The control will be compiled as a library.  You write the following code segment for the SharedControl control: 01 protected override void OnInit(EventArgs e)   02 {   03   base.OnInit(e);   04 ►  05 }    All the master pages in the ASP.NET application contain the following directive. %@ Master Language="C#" EnableViewState="false" %    You need to ensure that the state of the SharedControl control can persist on the pages that reference a master page.  Which code segment should you insert at line 04?()A、Page.RegisterRequiresPostBack(this); B、Page.RegisterRequiresControlState(this); C、Page.UnregisterRequiresControlState(this); D、Page.RegisterStartupScript("SharedControl","server");

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

考题 单选题You have a master page custom.master ... u create a nested.master page using it ... and then u have content page that uses the nested.master as its master page ...  to get a string prop from custom.master into a label in content page the code u wud use()A master.masterB parent.masterC this.masterD unknown

考题 单选题You work as a Web Developer at Certkiller.com. You make use of Microsoft ASP.NET 3.5 in orderto create a Web Site.  In a separate code file you create the following class:  public static class _Colors {  public static Color NormalActivityColor = Color.Green;  public static Color WarningActivityColor = Color.Yellow;  public static Color ErrorActivityColor = Color.Red;    public static Color GetRandomColor()  {  Random random = new Random((int)DateTime.Now.Ticks);  int randomArgbValue = random.Next();  Color color = Color.FromArgb(255, Color.FromArgb(randomArgbValue));  return color;  }  }  You need to ensure that the class is consumed by the Web Site. You have to configure the WebSite project.  What should you do?()A You should add the file to the App_Code folder of the project.B You should add a Register directive that will reference the file to every page that makes use ofthe class.C This can be accomplished by referencing the file in the assemblies segment of the Web.configfile.D This can be accomplished by referencing the file in the httpHandlers segment of the Web.configfile.

考题 单选题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

考题 单选题You create a master page named Article.master. Article.master serves as the template for articles on your Web site. The master page uses the following page directives. You need to create a content page that uses the master page as a template. In addition, you need to use a single master page for all devices that access the Web site. Which code segment should you use? ()A %@ Page Language=C# Theme=article%B %@ Page Language=C# MasterPageFile=~/article.master%C %@ Page Language=C# ie:MasterPageFile=~/article.master%D %@Page Language=C# all:MasterPageFile=~/article.master%