单选题You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application allows users to post comments to a page that can be viewed by other users. You add a SqlDataSource control named SqlDS. You write the following code segment:   01 private void SaveComment()   02 {   03   string ipaddr;   04 ►  05   SqlDS1.InsertParameters["IPAddress"].DefaultValue = ipaddr;   06   ...  07   SqlDS1.Insert();   08 }   You need to ensure that the IP Address of each user who posts a comment is captured alongwith the user’s comment.  Which code segment should you insert at line 04?()Aipaddr = Server[REMOTE_ADDR].ToString(); Bipaddr = Session[REMOTE_ADDR].ToString(); Cipaddr = Application[REMOTE_ADDR].ToString(); Dipaddr = Request.ServerVariables[REMOTE_ADDR].ToString();

单选题
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application allows users to post comments to a page that can be viewed by other users. You add a SqlDataSource control named SqlDS. You write the following code segment:   01 private void SaveComment()   02 {   03   string ipaddr;   04 ►  05   SqlDS1.InsertParameters["IPAddress"].DefaultValue = ipaddr;   06   ...  07   SqlDS1.Insert();   08 }   You need to ensure that the IP Address of each user who posts a comment is captured alongwith the user’s comment.  Which code segment should you insert at line 04?()
A

ipaddr = Server[REMOTE_ADDR].ToString(); 

B

ipaddr = Session[REMOTE_ADDR].ToString(); 

C

ipaddr = Application[REMOTE_ADDR].ToString(); 

D

ipaddr = Request.ServerVariables[REMOTE_ADDR].ToString();


参考解析

解析: 暂无解析

相关考题:

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a custom-templated server control.  You need to ensure that the child controls of the server control are uniquely identified within the control hierarchy of the page.  Which interface should you implement?()A、the ITemplatable interface B、the INamingContainer interface C、the IRequiresSessionState interfaceD、the IPostBackDataHandler interface

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.

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.  You create a Web page to display photos and captions. The caption of each photo in the database can be modified by using the application. You write the following code fragment.  | English | Chinese | Japan | Korean | - 123 - Test Information Co., Ltd. All rights reserved.    ’ runat="server"/         ’ runat="server" /        When you access the Web page, the application throws an error.  You need to ensure that the application successfully updates each caption and stores it in the database.  What should you do? ()A、Add the ID attribute to the Label control.B、Add the ID attribute to the TextBox control.C、Use the Bind function for the Label control instead of the Eval function.D、Use the Eval function for the TextBox control instead of the Bind function.

You have a Microsoft ASP.NET Framework version 1.0 application. The application does not use any features that are deprecated in the Microsoft .NET Framework version 3.5. The application runs on Microsoft IIS 6.0.  You need to configure the application to use the ASP.NET Framework version 3.5 without recompiling the application.  What should you do?()A、Edit the ASP.NET runtime version in IIS 6.0. B、Edit the System.Web section handler version number in the machine.config file. C、Add the requiredRuntime configuration element to the Web.config file and set the version attribute to v3.5. D、Add the supportedRuntime configuration element in the Web.config file and set the version attribute to v3.5.

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.  You create a custom-templated server control.  | English | Chinese | Japan | Korean | - 112 - Test Information Co., Ltd. All rights reserved. You need to ensure that the child controls of the server control are uniquely identified within thecontrol hierarchy of the page.  Which interface should you implement? ()A、the ITemplatable interfaceB、the INamingContainer interfaceC、the IRequiresSessionState interfaceD、the IPostBackDataHandler interface

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. (Line numbers are included for  reference only.)  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  | English | Chinese | Japan | Korean | - 87 - Test Information Co., Ltd. All rights reserved. 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 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. (Line numbers are included for reference only.)  01 Protected Overloads Overrides Sub OnInit(ByVal e As EventArgs)  02 MyBase.OnInit(e)  03  04 End Sub  All the master pages in the ASP.NET application contain the following directive.  %@ Master Language="VB" 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 03?()A、Page.RegisterRequiresPostBack(Me)B、Page.RegisterRequiresControlState(Me)C、Page.UnregisterRequiresControlState(Me)D、Page.RegisterStartupScript("SharedControl", "server")

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.  You create a custom-templated server control.  You need to ensure that the child controls of the server control are uniquely identified within the control hierarchy of the page.  Which interface should you implement?()A、the ITemplatable interfaceB、the INamingContainer interfaceC、the IRequiresSessionState interfaceD、the IPostBackDataHandler interface

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a Web page to display photos and captions. The caption of each photo in the database can be modified by using the application. You write the following code fragment:         ’ runat="server"/             ’ runat="server" /             When you access the Web page, the application throws an error.  You need to ensure that the application successfully updates each caption and stores it in the database.  What should you do?()A、Add the ID attribute to the Label control. B、Add the ID attribute to the TextBox control. C、Use the Bind function for the Label control instead of the Eval function. D、Use the Eval function for the TextBox control instead of the Bind function.

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

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application contains a DataSourceControl named CategoriesDataSource that is bound to a Microsoft SQL Server 2005 table. The CategoryName column is the primary key of the table. You write the following code fragment in a FormView control:   01    02   Category:   03      09      10     You need to ensure that the changes made to the CategoryID field can be written to the database.  Which code fragment should you insert at line 04?()A、SelectedValue='%# Eval("CategoryID") %' B、SelectedValue='%# Bind("CategoryID") %' C、SelectedValue='%# Eval("CategoryName") %' D、SelectedValue='%# Bind("CategoryName") %'

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.

单选题You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application allows users to post comments to a page that can be viewed by other users. You add a SqlDataSource control named SqlDS. You write the following code segment:   01 private void SaveComment()   02 {   03   string ipaddr;   04 ►  05   SqlDS1.InsertParameters["IPAddress"].DefaultValue = ipaddr;   06   ...  07   SqlDS1.Insert();   08 }   You need to ensure that the IP Address of each user who posts a comment is captured alongwith the user’s comment.  Which code segment should you insert at line 04?()Aipaddr = Server[REMOTE_ADDR].ToString(); Bipaddr = Session[REMOTE_ADDR].ToString(); Cipaddr = Application[REMOTE_ADDR].ToString(); Dipaddr = Request.ServerVariables[REMOTE_ADDR].ToString();

单选题You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.  You create a Web page to display photos and captions. The caption of each photo in the database can be modified by using the application. You write the following code fragment.  | English | Chinese | Japan | Korean | - 123 - Test Information Co., Ltd. All rights reserved.    ’ runat="server"/         ’ runat="server" /        When you access the Web page, the application throws an error.  You need to ensure that the application successfully updates each caption and stores it in the database.  What should you do? ()AAdd the ID attribute to the Label control.BAdd the ID attribute to the TextBox control.CUse the Bind function for the Label control instead of the Eval function.DUse the Eval function for the TextBox control instead of the Bind function.

单选题You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a Web form in the application by using the following code fragment:   01     02 protected void Button_Handler(object sender, EventArgs e)   03 {   04   // some long-processing operation.  05 }   06    07  A AB BC CD D

单选题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.     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?()APage.RegisterRequiresPostBack(this); BPage.RegisterRequiresControlState(this); CPage.UnregisterRequiresControlState(this); DPage.RegisterStartupScript(SharedControl,server);

单选题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. (Line numbers are included for reference only.)  01 Protected Overloads Overrides Sub OnInit(ByVal e As EventArgs)  02 MyBase.OnInit(e)  03  04 End Sub  All the master pages in the ASP.NET application contain the following directive.    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 03?()APage.RegisterRequiresPostBack(Me)BPage.RegisterRequiresControlState(Me)CPage.UnregisterRequiresControlState(Me)DPage.RegisterStartupScript(SharedControl, server)

单选题You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.  You host the application on a server named ContosoTest that runs Microsoft IIS 6.0. You set up remote debugging on the ContosoTest server.  You need to debug the application remotely from another computer named ContosoDev. What should you do? ()AAttach Microsoft Visual Studio.NET to the w3wp.exe process.BAttach Microsoft Visual Studio.NET to the inetinfo.exe process.CAttach Microsoft Visual Studio.NET to the Msvsmon.exe process.DAttach Microsoft Visual Studio.NET to the WebDev.WebServer.exe process.

单选题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?()AStart Microsoft IIS 6.0.BStart the Application pool.CSet the .NET Framework version.DAdd the Web.config file for the application.

单选题You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.  You create a custom-templated server control.  | English | Chinese | Japan | Korean | - 112 - Test Information Co., Ltd. All rights reserved. You need to ensure that the child controls of the server control are uniquely identified within thecontrol hierarchy of the page.  Which interface should you implement? ()Athe ITemplatable interfaceBthe INamingContainer interfaceCthe IRequiresSessionState interfaceDthe IPostBackDataHandler interface

单选题You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a Web page to display photos and captions. The caption of each photo in the database can be modified by using the application. You write the following code fragment:         ’ runat="server"/             ’ runat="server" /             When you access the Web page, the application throws an error.  You need to ensure that the application successfully updates each caption and stores it in the database.  What should you do?()AAdd the ID attribute to the Label control. BAdd the ID attribute to the TextBox control. CUse the Bind function for the Label control instead of the Eval function. DUse the Eval function for the TextBox control instead of the Bind function.

单选题You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application contains a DataSourceControl named CategoriesDataSource that is bound to a Microsoft SQL Server 2005 table. The CategoryName column is the primary key of the table. You write the following code fragment in a FormView control:   01    02   Category:   03      09      10     You need to ensure that the changes made to the CategoryID field can be written to the database.  Which code fragment should you insert at line 04?()ASelectedValue='%# Eval(CategoryID) %' BSelectedValue='%# Bind(CategoryID) %' CSelectedValue='%# Eval(CategoryName) %' DSelectedValue='%# Bind(CategoryName) %'

单选题You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a Web form in the application by using the following code fragment:   01     02 protected void Button_Handler(object sender, EventArgs e)   03 {   04   // some long-processing operation.  05 }   06    07  AABBCCDD

单选题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?()Acompilation debug=true Bcompilation debug=false Ccompilation debug=true batch=true Dcompilation debug=false batch=false

单选题You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.  You create a custom-templated server control.  You need to ensure that the child controls of the server control are uniquely identified within the control hierarchy of the page.  Which interface should you implement?()Athe ITemplatable interfaceBthe INamingContainer interfaceCthe IRequiresSessionState interfaceDthe IPostBackDataHandler interface

单选题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?()AIn the Web.config file of the application,set the Theme attribute of the pages element to the name of the theme.BIn the Web.config file of the application,set the StyleSheetThemeattribute of the pages element to the name of the theme.CAdd a master page to the application. In the @Master directive,set the Theme attribute to the name of the theme.DAdd a master page to the application. In the @Master directive,set the StyleSheetTheme attribute to the name of the theme.

单选题You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a custom-templated server control.  You need to ensure that the child controls of the server control are uniquely identified within the control hierarchy of the page.  Which interface should you implement?()Athe ITemplatable interface Bthe INamingContainer interface Cthe IRequiresSessionState interfaceDthe IPostBackDataHandler interface