|
Question |
Rating |
View Answer |
|
You are a member of a team of developers creating several ASP.NET applications for XYZ. You want to create a reusable toolbar that will be used in each of the applications. The toolbar will be displayed at the top of each page viewed by the user. The contents of the toolbar will vary depending on options each user selects when creating a profile. You want to be able to add the toolbar to the ASP.NET toolbox for each of the developers on your team. What should you do? A. Create a new Web Control Library project. Create the toolbar within a Web custom control. B. Add a new Web user control to your ASP.NET project. Create the toolbar within the Web user control. C. Add a new Web Form to your ASP.NET project. Design the toolbar within the Web Form and save the Web Form with an .ascx extension. D. Add a new component class to your ASP.NET project. Design the toolbar within the designer of the component class.
|
|
View Answer |
|
You create an ASP.NET application to provide corporate news and information to XYZ’s employees. The application is used by employees in New Zealand. Default.aspx has a Web Form label control named currentDateLabel. The Page.Load event handler for Default.aspx included the following line of code: currentDateLabel.Text = DateTime.Now.ToString(“D”) You need to ensure that the data is displayed correctly for employees in New Zealand. What should you do? A. In the Web.config file for the application, set the culture attribute of the globalization element to en-NZ. B. In the Web.config file for the application, set the uiCulture attribute of the globalization element to en-NZ. C. In Visual Studio .NET, set the responseEncoding attribute in the page directive for Default.aspx to UTF-8. D. In Visual Studio .NET, save the Default.aspx page for both versions of the application by selecting Advanced Save Options from the File menu and selecting UTF-8.
|
|
View Answer |
|
You create a Web custom control named EXToggle that users can turn on and off. The EXToggle control includes a Button control named toggleButton. You write an event handler named toggleButton_Click for the toggleButton.Click event. This event adjusts the BorderStyle property to signify whether the Button is toggled on or off. You want to add code to the EXToggle class so that when toggleButton is clicked, pages that contain instances of EXToggle can process custom event handling code. You add the following code to the EXToggle class: public event EventHandler ChangedValue; protected void OnChangedValue(EventArgs e) { ChangedValue(this, e); } You need to add code to the toggleButton_Click so that pages that contain instances of EXToggle can handle the ChangedValue event and process custom event handling code. Which lines of code are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two) A. ChangedValue(this, EventArgs.Empty); B. s.Click += new System.EventHandler(this.OnChangedValue); C. OnChangedValue(EventArgs.Empty); D. OnChangedValue(this, EventArgs.Empty);
|
|
View Answer |
|
You create an ASP.NET page that allows a user to enter a requested delivery date in a TextBox control named requestEXDate. The date must be no earlier than two business days after the order date, and no later that 60 business days after the order date. You add a CustomValidator control to your page. In the Properties window, you set the ControlToValidate property to requestEXDate. You need to ensure that the date entered in the requestDate TextBox control falls within the acceptable range of values. In addition, you need to minimize the number of round trips to the server. What should you do? A. Set the AutoPostBack property of requestDate to False. Write code in the ServerValidate event handler to validate the date. B. Set the AutoPostBack property of requestDate to True. Write code in the ServerValidate event handler to validate the date. C. Set the AutoPostBack property of requestDate to False. Set the ClientValidationFunction property to the name of a script function contained in the HTML page that is sent to the browser. D. Set the AutoPostBack property of requestDate to True. Set the ClientValidationFunction property to the name of a script function contained in the HTML page that is sent to the browser.
|
|
View Answer |
|
You are creating an ASP.NET application for XYZ. Your application will call an XML Web service run by Wide World Importers. The XML Web service will return an ADO.NET DataSet object containing a list of companies that purchase wine. You need to make the XML Web service available to your application. What should you do? A. On the .NET tab of the Reference dialog box, select System.Web.Services.dll. B. In the Web References dialog box, type the address of the XML Web service. C. Add a using statement to your Global.asax.cs file, and specify the address of the XML Web service. D. Write an event handler in the Global.asax.cs file to import the .wsdl and .disco files associated with the XML Web service.
|
|
View Answer |
|
You are creating an ASP.NET application to track XYZ sales orders. The application uses an ADO.NET DataSet object that contains two DataTable objects. One table is named Orders, and the other table is named OrderDetails. The application displays data from the Orders table in a list box. You want the order details for an order to be displayed in a grid when a user selects the order in the list box. You want to modify these objects to enable your code to find all the order details for the selected order. What should you do? A. Add a DataRelation object to the Relations collection of the DataSet object. B. Use the DataSet.Merge method to connect the Orders table and the OrderDetails table to each other. C. Add a ForeignKeyConstraint to the OrderDetails table. D. Add a keyref constraint to the DataSet schema.
|
|
View Answer |
|
You create an ASP.NET application to provide online order processing to XYZ customers. A page named ShippingInformation.aspx contains a Web Form with controls for collecting shipping location information. The Web Form contains the following elements: • Four TextBox controls for entry of name, street address, city, and postal code. • A DropDownList control that consists of the full names of 150 countries. • A Button control named shipItButton. The Click event handler for shipItButton is located in the code-behind file for ShippingInformation.aspx. None of the other controls on the Web Form define server-side event handlers. The Click event handler for ShipItButton redirects the user to a page named ShippingConfirmation.aspx. The ShippingConfirmation.aspx page provides the confirmation status of the shipping request submission to the user. Users who access the application by using dial-up connections report that ShippingInformation.aspx processes very slow after the user clicks the shipItButton. Users on high-bandwidth network connections do not report the same issue. You need to decrease the delay experienced by the dial-up users. What should you do? A. Add the following attribute to the Page directive for ShippingInformation.aspx: EnableViewState=”False” B. Add the following attribute to the Page directive for ShippingInformation.aspx: SmartNavigation=”True” C. Add the following attribute to the OutputCache directive for ShippingInformation.aspx: Location=”server” D. Add the following attribute to the OutputCache directive for ShippingInformation.aspx. Location=”client”
|
|
View Answer |
|
ou are a Web developer for XYZ. You create an ASP.NET application that accesses sales and marketing data. The data is stored in a Microsoft SQL Server 2000 database on a server named XYZ01. The company purchases a factory automation software application. The application is installed on XYZ01, where it creates a second instance of SQL Server 2000 named Factory and a database named FactoryDB. You connect to FactoryDB by using Windows Integrated authentication. You want to add a page to your ASP.NET application to display inventory data from FactoryDB. You use a SqlConnection object to connect to the database. You need to create a connection string to FactoryDB in the instance of SQL Server named Factory on XYZ01. Which string should you use? A. “Server=XYZ01;Data Source=Factory; Initial Catalog=FactoryDB;Integrated Security=SSPI” B. “Server=XYZ01;Data Source=Factory; Database=FactoryDB;Integrated Security=SSP1” C. “Data Source=XYZ01Factory; Initial Category=Factory; Integrated Security=SSP1” D. “Data Source=XYZ01Factory; Database=FactoryDB; Integrated Security=SSP1”
|
|
View Answer |
|
You ASP.NET application manages order entry data by using a DataSet object named EXorderEntry. The EXorderEntry object includes two DataTable objects named orderNames and OrderDetails. A ForeignKeyConstraint object named orderDetailsKey is defined between the two DataTable objects. You attempt to delete a row in orderNames while there are related rows in OrderDetails, and an exception is generated. What is the most likely cause of the problem? A. The current value of OrderDetails.KeyDeleteRule is Rule.Cascade. B. The current value of OrderDetails.KeyDeleteRule is Rule.SetNull. C. The current value of OrderDetails.KeyDeleteRule is Rule.SetDefault. D. The current value of OrderDetails.KeyDeleteRule is Rule.None. |
|
View Answer |
|
You are creating an ASP.NET application to track XYZ sales orders. The application uses an ADO.NET DataSet object that contains two DataTable objects. One table is named Orders, and the other table is named OrderDetails. The application displays data from the Orders table in a list box. You want the order details for an order to be displayed in a grid when a user selects the order in the list box. You want to modify these objects to enable your code to find all the order details for the selected order. What should you do? A. Add a DataRelation object to the Relations collection of the DataSet object. B. Use the DataSet.Merge method to connect the Orders table and the OrderDetails table to each other. C. Add a ForeignKeyConstraint to the OrderDetails table. D. Add a keyref constraint to the DataSet schema.
|
|
View Answer |
|
You create an ASP.NET application to provide online order processing to XYZ customers. A page named ShippingInformation.aspx contains a Web Form with controls for collecting shipping location information. The Web Form contains the following elements: • Four TextBox controls for entry of name, street address, city, and postal code. • A DropDownList control that consists of the full names of 150 countries. • A Button control named shipItButton. The Click event handler for shipItButton is located in the code-behind file for ShippingInformation.aspx. None of the other controls on the Web Form define server-side event handlers. The Click event handler for ShipItButton redirects the user to a page named ShippingConfirmation.aspx. The ShippingConfirmation.aspx page provides the confirmation status of the shipping request submission to the user. Users who access the application by using dial-up connections report that ShippingInformation.aspx processes very slow after the user clicks the shipItButton. Users on high-bandwidth network connections do not report the same issue. You need to decrease the delay experienced by the dial-up users. What should you do? A. Add the following attribute to the Page directive for ShippingInformation.aspx: EnableViewState=”False” B. Add the following attribute to the Page directive for ShippingInformation.aspx: SmartNavigation=”True” C. Add the following attribute to the OutputCache directive for ShippingInformation.aspx: Location=”server” D. Add the following attribute to the OutputCache directive for ShippingInformation.aspx. Location=”client”
|
|
View Answer |
|
You are a Web developer for XYZ. You create an ASP.NET application that accesses sales and marketing data. The data is stored in a Microsoft SQL Server 2000 database on a server named XYZ01. The company purchases a factory automation software application. The application is installed on XYZ01, where it creates a second instance of SQL Server 2000 named Factory and a database named FactoryDB. You connect to FactoryDB by using Windows Integrated authentication. You want to add a page to your ASP.NET application to display inventory data from FactoryDB. You use a SqlConnection object to connect to the database. You need to create a connection string to FactoryDB in the instance of SQL Server named Factory on XYZ01. Which string should you use? A. “Server=XYZ01;Data Source=Factory; Initial Catalog=FactoryDB;Integrated Security=SSPI” B. “Server=XYZ01;Data Source=Factory; Database=FactoryDB;Integrated Security=SSP1” C. “Data Source=XYZ01Factory; Initial Category=Factory; Integrated Security=SSP1” D. “Data Source=XYZ01Factory; Database=FactoryDB; Integrated Security=SSP1”
|
|
View Answer |
|
You create an ASP.NET application and deploy it on a test server named XYZSrv. The application consists of a main page that links to 30 other pages containing ASP.NET code. You want to accomplish the following goals: • Enable tracing on all the pages in the application except the main page. • Display trace output for up to 40 requests. • Ensure that trace output is appended to the bottom of each of the pages that will contain trace output. • Ensure that any configuration changes affect only this application. You need to accomplish these goals with the minimum amount of development effort. Which three actions should you take? (Each correct answer presents part of the solution. Choose three) A. Add the following element to the Web.config file: <trace enabled=”true” pageOutput=”true”/> B. Add the following attribute to the Trace element of the application’s Web.config file: requestLimit=40 C. Add the following attribute to the Trace element of the application’s Machine.config file: requestLimit=40 D. Set the Trace attribute of the Page directive to true for each page except the main page. E. Set the Trace attribute of the Page directive to false for the main page. F. Set the TraceMode attribute of the Page directive to SortByTime for the main page.
|
|
View Answer |
|
XYZ is developing an ASP.NET application for producing comparative insurance quotes from multiple insurance carries. XYZ wants the application to provide quotes to a user after the user answers questions about individual insurance needs. You deploy a copy of the application to XYZ’s testing environment so that you can perform unit testing. The Machine.config file on the testing server contains the following element: <trace enabled=”false” pageOutput=”false”/> The Web.config file for your application contains the following element: <trace enabled=”false” pageOutput=”false”/> When you run the application, you find that not all insurance carries are being displayed on the quote result page. You attempt to view the trace output information for the quote results page by browsing to the trace.axd URL for your application. No trace information is shown. You want to be able to examine trace output information by using trace.axd. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two) A. Modify the element in the Machine.config file as follows: <trace enabled=”true” pageOutput=”false”/> B. Modify the element in the Machine.config file as follows: <trace enabled=”true” pageOutput=”true”/> C. Modify the element in the Web.config file as follows: <trace enabled=”true” pageOutput=”false”/> D. Modify the element in the Web.config file as follows: <trace enabled=”true” pageOutput=”true”/> E. Modify the Page directive for the quote results page so that it contains the following entry: Trace=”true”
|
|
View Answer |
|
You create an ASP.NET application that will run on XYZ’s Internet Web site. Your application contains 100 Web pages. You want to configure your application so that it will display customized error messages to users when an HTTP code error occurs. You want to log the error when an ASP.NET exception occurs. You want to accomplish these goals with the minimum amount of development effort. Which two actions should you take? (Each correct answer presents part of the solution. Choose two) A. Create an Application_Error procedure in the Global.asax file for your application to handle ASP.NET code errors. B. Create an applicationError section in the Web.config file for your application to handle ASP.NET code errors. C. Create a CustomErrors event in the Global.asax file for your application to handle HTTP errors. D. Create a CustomErrors section in the Web.config file for your application to handle HTTP errors. E. Add the Page directive to each page in the application to handle ASP.NET code errors. F. Add the Page directive to each page in the application to handle HTTP errors.
|
|
View Answer |
|
You create an ASP.NET application for XYZ. The company uses Microsoft Windows authentication. All users are in the XYZ domain. You want to configure the application to use the following authorization rules: • Anonymous users must not be allowed to access the application. • All employees except Martin and Peter must be allowed to access the application. Which code segment should you use to configure the application?. A. <authorization> <deny users=”XYZMartin, XYZPeter”> <allow users=”*”> <deny users=”?”> </authorization> B. <authorization> <allow users=”*”> <deny users=”XYZMartin, XYZPeter”> <deny users=”?”> </authorization> C. <authorization> <deny users=”XYZMartin, XYZPeter”> <deny users=”?”> <allow users=”*”> </authorization> D. <authorization> <allow users=”XYZMartin, XYZPeter”> <allow users=”*”> </authorization> E. <authorization> <allow users=”*”> <deny users=”XYZMartin, XYZPeter”> </authorization>
|
|
View Answer |
|
You create an ASP.NET application. You implement tracing and debugging instrumentation. The application is deployed on XYZ’s intranet. After working with the application for several days, users report that some pages are displaying errors that incorrectly identify valid date values as being invalid. You need to gather debugging information from the application while it is running in the production environment. You need to perform this task with the least impact on the performance of the application. What should you do? A. Enable Debug mode in the application’s Web.config file on the production server. Use Visual Studio .NET on your client computer to select Debug Processes from the Tools menu and attach to the aspnet_wp.exe process on the production server. B. Enable Debug mode in the application’s Web.config file on the production server. Use Visual Studio .NET on your client computer to open the application project on the production server and select Start from the Debug menu. C. Enable application tracing and disable tracing page output in the application’s Web.config file on the production server. View the debugging information on the trace.axd page. D. Enable application tracing and disable tracing page output in the application’s Web.config file on the production server. Run the DbgClr.exe and attach to the aspnet_wp.exe process on the production server.
|
|
View Answer |
|
You are creating an ASP.NET page for a travel service. The page contains a CheckBoxList control that contains travel destinations. Customer can select favorite destinations to receive weekly e-mail updates of travel packages. The CheckBoxList control is bound to a database table of possible destinations. Each destination is ranked according to its popularity. You modify the page to sort the destination list by rank, from the most popular to the least popular. The list has three columns. You want the most popular destination to be on the top row of the check box list at run time. Which property setting should you use for the CheckBoxList control? A. Set the RepeatDirection property to Vertical. B. Set the RepeatDirection property to Horizontal. C. Set the RepeatLayout property to Flow. D. Set the RepeatLayout property to Table.
|
|
View Answer |
|
You are creating an ASP.NET page to enroll new members in a health care program for XYZ employees. One of the requirements for membership is that a participant must be at least 65 years old. You need to ensure that each prospective member enters a name in a TextBox control named nameTextBox and a date of birth in a TextBox control named birthdayTextBox. In addition, you need to verify that prospective members meet the age requirement. What should you do? A. Add a CustomValidator to the page. In the Properties window, set the ControlToValidate property to birthdayTextBox. Write code to validate the date of birth. Add a RegularExpressionValidator control to the page. In the Properties window, set the ControlToValidate property to nameTextBox, and create a regular expression to validate the name. B. Add a CompareValidator control to the page. In the Properties window, set the ControlToValidate property to birthdayTextBox. Write code that sets the Operator and ValueToCompare properties to validate the date of birth. Add a RequiredFieldValidator control to the page. In the Properties window, set the ControlToValidate property to nameTextBox. C. Add a RangeValidator control to the page. In the Properties window, set the ControlToValidate property to birthdayTextBox. Write code that sets the MinimumValue and MaximumValue properties to validate the date of birth. Add a CompareValidator control to the page. In the Properties window, set the ControlToValidate property to nameTextBox. Add a second CompareValidator control to the page. In the Properties window, set the ControlToValidate property to birthdayTextBox. Write code that sets the Operator and ValueToCompare properties of the two CompareValidator controls to validate the name and date of birth. D. Add a CustomValidator control to the page. In the Properties window, set the ControlToValidate property to birthdayTextBox, and write code to validate the date of birth. Add a RequiredFieldValidator control to the page. In the Properties window, set the ControlToValidate property to nameTextBox. Add a second RequiredFieldValidator control to the page. In the Properties window, set the ControlToValidate property to birthdayTextBox.
|
|
View Answer |
|
ou are creating a new ASP.NET page named ItemList that displays item and price information for many different items. When a user logs on to the Web site, the page retrieves the current list of prices from a database. ItemList will be accessed by several thousand registered users. When a price list is retrieved for a user, the prices remain valid for as long as the user continues to access the page. Users are allowed to keep the same price list for several days. When ItemList is posted back to the server, you want to ensure that the price list was not altered on the user’s computer. You also want to minimize the memory resources consumed on the Web server. Which three parameters should you add to the Page directive in ItemList? (Each correct answer presents part of the solution. Choose three) A. EnableSessionState=”True” B. EnableSessionState=”False” C. EnableSessionState=”ReadOnly” D. EnableViewState=”True” E. EnableViewState=”False” F. EnableViewStateMac=”True” G. EnableViewStateMac=”False”
|
|
View Answer |