You create a Web Form. The Web Form uses the FormView control to enable a user to edit a record in the database. When the user clicks the Update button on the FormView control, the application must validate that the user has entered data in all of the fie

题目

You create a Web Form. The Web Form uses the FormView control to enable a user to edit a record in the database. When the user clicks the Update button on the FormView control, the application must validate that the user has entered data in all of the fields. You need to ensure that the Web Form does not update if the user has not entered data in all of the fields. Which code segment should you use? ()

  • A、protectedvoidFormView1_ItemUpdating(objectsender,FormViewUpdateEventArgse){foreach(DictionaryEntryentryine.Keys){if(entry.Value.ToString()==System.String.Empty){e.Cancel=true;return;}}}
  • B、protectedvoidFormView1_ItemUpdated(objectsender,FormViewUpdateEventArgse){foreach(DictionaryEntryentryine.NewKeys){if(entry.Value.Equals(“”)){e.KeepEditMode=true;return;}}}
  • C、protectedvoidFormView1_ItemUpdating(objectsender,FormViewUpdateEventArgse){foreach(DictionaryEntryentryine.NewValues){if(entry.Value.Equals(“”)){e.Cancel=true;return;}}}
  • D、protectedvoidFormView1_ItemUpdating(objectsender,FormViewUpdateEventArgse){foreach(DictionaryEntryentryine.Keys){if(entry.Value.ToString()==System.String.Empty){e.KeepInEditMode=true;return;}}}

相似考题
更多“You create a Web Form. The Web F”相关问题
  • 第1题:

    You have a server named Server1 that runs Windows Server 2003 Web Edition Service Pack 2 (SP2). You create a new virtual directory named App1. App1 contains a Web application. Users report that when they enter http://app1 in their Web browsers, they are unable to connect to the Web application. You need to ensure that users can access the Web application when they connect to http://app1. What should you do? ()

    • A、Move the content of the Web application to C:/App1. Change the home directory for App1.
    • B、Move the content of the Web application to C:/App1. Change the application pool for App1.
    • C、Remove the App1 virtual directory. Create a new Web site, and then configure the Web site to use port 8080. In DNS, create a Host record for App1.
    • D、Remove the App1 virtual directory. Create a new Web site, and then configure the Web site to use a host header of App1. In DNS, create a Host record for App1.

    正确答案:D

  • 第2题:

    You need to design a configuration for the Microsoft Outlook Web Access servers. What should you do?()

    • A、Create a Network Load Balancing cluster that contains the Outlook Web Access servers
    • B、Create a Microsoft Cluster Server cluster that contains the Outlook Web Access servers
    • C、Create public DNS host (A) resource records for each Outlook Web Access server. Instruct each user to connect to the server that contains his or her mailbox
    • D、Install Microsoft Application Center 2000 on the Outlook Web Access servers. Create a Web cluster that contains all of the Outlook Web Access servers

    正确答案:A

  • 第3题:

    You create a Web site that you must copy from a development server to a testing server, along with all source files. You do not have terminal access to the testing server. You need to create the virtual directory. Then you must copy the Web site to the virtual directory on the testing server without precompiling the site. What should you do? ()

    • A、Use the Publish Web tool.
    • B、Use the Copy Web tool.
    • C、Use the command line to XCOPY the files.
    • D、Create a Web Setup project.

    正确答案:B

  • 第4题:

    You create a Web Form. The Web Form contains two Web Parts named CustomerPart and OrdersPart. CustomerPart contains a drop-down list of customers. OrdersPart contains a list of orders that a customer has placed. You need to create a static connection between CustomerPart and OrdersPart. When a user selects a customer from CustomerPart, OrdersPart must update. Which four actions should you perform? ()

    • A、Add the ConnectionProvider attribute to OrdersPart.
    • B、Add the ConnectionProvider attribute to CustomerPart.
    • C、Add the ConnectionConsumer attribute to CustomerPart.
    • D、Add the ConnectionConsumer attribute to OrdersPart.
    • E、Add OrdersPart and CustomerPart to the WebParts directory.
    • F、Add OrdersPart and CustomerPart to the App_Code directory.
    • G、Declare the connections within a StaticConnections subtag of a WebPartZone class.
    • H、Declare the connections within a StaticConnections subtag of a WebPartManager class.
    • I、Define an interface specifying the methods and properties that are shared between the Web Parts.

    正确答案:B,D,H,I

  • 第5题:

    You create a Web site. You add an EditorZone control to the home page on the Web site. You need to enable users to customize the size and location of the Web Parts on their home pages. Which two controls should you add to the EditorZone control?()

    • A、BehaviorEditorPart
    • B、AppearanceEditorPart
    • C、PropertyGridEditorPart
    • D、LayoutEditorPart

    正确答案:B,D

  • 第6题:

    You are creating a custom control. The UI of the control must contain several text boxes and two buttons. The control must be available in the global assembly cache for reuse across multiple Web applications. You need to achieve this functionality by using the minimum amount of code. What should you do? ()

    • A、Create a control that derives from System.Web.UI.Control.
    • B、Create a control that derives from System.Web.UI.WebControls.CompositeControl.
    • C、Create a control that derives from System.Web.UI.WebControls.WebControl.
    • D、Create a control that derives from System.Web.UI.UserControl.

    正确答案:B

  • 第7题:

    单选题
    You create a Web site that you must copy from a development server to a testing server, along with all source files. You do not have terminal access to the testing server. You need to create the virtual directory. Then you must copy the Web site to the virtual directory on the testing server without precompiling the site. What should you do? ()
    A

    Use the Publish Web tool.

    B

    Use the Copy Web tool.

    C

    Use the command line to XCOPY the files.

    D

    Create a Web Setup project.


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

  • 第8题:

    多选题
    You create a Web Form that contains connected Web Parts. You write the following declaration in your Web Form.You need to ensure that your Web Part connection is valid. Which two actions should you perform? ()
    A

    Include a data source identified as WebPartConnection1 on the Web Form.

    B

    Include a Web Part identified as customerPart on the Web Form.

    C

    Include a Web Part identified as ordersPart on the Web Form.

    D

    Ensure that you declare an interface named IOrdersPart.

    E

    Ensure that you declare an interface named ICustomerPart.

    F

    Ensure that each Web Part declares either a GetInterface or ProvideInterface method.


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

  • 第9题:

    单选题
    You create a Web Form that contains a text box named txtDate. You want the text box to allow users to enter any valid date. You need to use an ASP.NET validation control to ensure that only valid date values are submitted to the server. What should you do?()
    A

    Add a CompareValidator control to the Web Form. Set its ControlToValidate property to txtDate. Set its Type property to Date. Set its Operator property to DataTypeCheck.

    B

    Add a RangeValidator control to the Web Form. Set its ControlToValidate property to txtDate. Set its Type property to Date. Set its MinimumValue property to 01/01/1900 and its MaximumValue to the current date.

    C

    Add a CustomValidator control to the Web Form. Set its ControlToValidate property to txtDate. Write a function in the partial class that verifies the values as dates and returns a Boolean variable. Set the CustomValidators ClientValidationFunction to the name of your function.

    D

    Add a RegularExpressionValidator control to the Web Form. Set its ControlToValidate property to txtDate. Set the ValidationExpression property to ensure that the users input follows the format of nn-nn-nnnn, where n represents a number from 0 through 9.


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

  • 第10题:

    Your network consists of a single Active Directory domain. All servers run Windows Server 2008 R2.   You plan to publish a Web site on two Web servers.   You need to deploy an availability solution for your Web servers that meets the following requirements: èSupports the addition of more Web servers without interrupting client connections  èEnsures that the Web site is accessible even if a single server fails What should you do?()

    • A、Configure a failover cluster.
    • B、Configure a Web garden on each Web server.
    • C、Create a Network Load Balancing cluster.
    • D、Create two application pools on each Web server.

    正确答案:C

  • 第11题:

    You create a Web Form that contains connected Web Parts. You write the following declaration in your Web Form. You need to ensure that your Web Part connection is valid. Which two actions should you perform? ()

    • A、Include a data source identified as "WebPartConnection1" on the Web Form.
    • B、Include a Web Part identified as "customerPart" on the Web Form.
    • C、Include a Web Part identified as "ordersPart" on the Web Form.
    • D、Ensure that you declare an interface named "IOrdersPart".
    • E、Ensure that you declare an interface named "ICustomerPart".
    • F、Ensure that each Web Part declares either a GetInterface or ProvideInterface method.

    正确答案:B,C

  • 第12题:

    You create a Web Form. You need to add controls that use adaptive rendering to display content. The type of content rendered must depend on the device that is requesting the page. What are two possible ways to achieve this goal? ()

    • A、Add custom controls that emit XHTML to the Web Form.
    • B、Add custom controls that emit WML to the Web Form.
    • C、Add mobile controls to the Web Form.
    • D、Add Web server controls to the Web Form.

    正确答案:C,D

  • 第13题:

    You create a Web Form. The Web Form allows users to recover their passwords. You add a PasswordRecovery server control by using the following code segment.You need to ensure that the server control generates a new password and sends it by e-mail to the users e?mail address. Which two actions should you perform?()

    • A、Create a valid definition in the Web.config file.
    • B、Set the passwordFormat attribute of the configured membership provider to Encrypted.
    • C、Ensure that the enablePasswordRetrieval attribute of the configured membership provider is set to False.
    • D、Ensure that the enablePasswordRetrieval attribute of the configured membership provider is set to True.

    正确答案:A,C

  • 第14题:

    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" /></connectionStrings>
    • D、Add the following code segment to the Web.config file.  <appSettings><add key="MySqlProviderConnection" value="valid connection string" /></appSettings>
    • E、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.

    正确答案:B,D

  • 第15题:

    You have a Web server named Web1 that runs Windows Server 2003 Service Pack 2 (SP2). Users on the internal network connect to the Web site on Web1 by using the URLhttp://www.contoso.com.  From the Internet, you cannot connect to the Web site by using the URL http://www.contoso.com. You can connect to the Web site by using the public IP address of Web1.You need to ensure that users on the Internet can connect to the Web site on Web1 by using the URL http://www.contoso.com. You deploy a DNS server that is accessible on the Internet.  What should you do next?()

    • A、Create a stub zone for contoso.com. 
    • B、Create a primary zone for contoso.com. 
    • C、Create a secondary zone for contoso.com. 
    • D、Configure a conditional forwarder for contoso.com. 

    正确答案:B

  • 第16题:

    多选题
    You create a Web Form that contains connected Web Parts. You write the following declaration in your Web Form. You need to ensure that your Web Part connection is valid. Which two actions should you perform? ()
    A

    Include a data source identified as WebPartConnection1 on the Web Form.

    B

    Include a Web Part identified as customerPart on the Web Form.

    C

    Include a Web Part identified as ordersPart on the Web Form.

    D

    Ensure that you declare an interface named IOrdersPart.

    E

    Ensure that you declare an interface named ICustomerPart.

    F

    Ensure that each Web Part declares either a GetInterface or ProvideInterface method.


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

  • 第17题:

    多选题
    You create a Web Form. The Web Form allows users to recover their passwords. You add a PasswordRecovery server control by using the following code segment.You need to ensure that the server control generates a new password and sends it by e-mail to the users e?mail address. Which two actions should you perform? ()
    A

    Create a valid definition in the Web.config file.

    B

    Set the passwordFormat attribute of the configured membership provider to Encrypted.

    C

    Ensure that the enablePasswordRetrieval attribute of the configured membership provider is set to False.

    D

    Ensure that the enablePasswordRetrieval attribute of the configured membership provider is set to True.


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