|
Question |
Rating |
View Answer |
|
You are creating an ASP.NET page for XYZ. You create a DataGrid control that displays past purchases made by the user. The DataGrid control is populated from an existing database when the page is created. The page contains TextBox controls that allow users to update their personal information, such as address and telephone number. You need to ensure that the page is refreshed as quickly as possible when users update their contact information. What should you do? A. Set the Enable property of the DataGrid control to false. B. Set the EnableViewState property of the DataGrid to false. C. Write code in the Page.Load event handler that populates the DataGrid control only when the IsPostBack property of the page is false. D. Write in the Page.Load event handler that populates the DataGrid control only when the IsPostBack property of the page is true.
|
|
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 are creating an ASP.NET application for an online payment service. The service allows users to pay their bills electronically by using a credit card. The application includes a payment page named Payment.aspx. This page contains a form for entering payee, payment amount, and credit card information. When a user needs to submit a new billing address to a payee, the page form allows the user to provide the new address information. If the user indicates a change of address, the application needs to provide the information to the ProcessAddressChange.aspx page for processing as soon as the user submits the payment page information. The ProcessAddressChange.aspx page processes the request for a change of address but does not provide any display information for the user. When the requested processing is complete. Payment.aspx displays status results to the user. You need to add a line of code to Payment.aspx to perform the functionality in ProcessAddressChange.aspx. Which line of code should you use? A. Response.Redirect(“ProcessAddressChange.aspx”); B. Response.WriteFile(“ProcessAddressChange.aspx”); C. Server.Transfer(“ProcessAddressChange.aspx”,True); D. Server.Execute(“ProcessAddressChange.aspx”);
|
|
View Answer |
|
You create an ASP.NET page to display a sorted list of products in a DataGrid control. The product data is stored in a Microsoft SQL Server database. Each product is identified by a numerical value named ProductID, and each product has an alphabetic description named ProductName. You write ADO.NET code that uses a SqlDataAdapter object and a SqlCommand object to retrieve the product data from the database by calling a stored procedure. You set the CommandType property of the SqlCommand object to CommandType.StoredProcedure. You set the CommandText property of the object to procProductList. Your code successfully fills a DataTable object with a list of products that is sorted by ProductID in descending order. You want the data to be displayed in reverse alphabetic order by ProductName. What should you do? A. Change the CommandType property setting of the SqlCommand object to CommandType.Text. Change the CommandText property setting of the SqlCommand object to the following: SELECT * FROM procProductList ORDER BY ProductName DESC; Bind the DataGrid control to the DataTable object. B. Create a new DataView object based on the DataTable object. Set the Sort Property of the DataView object to “ProductName DESC”. Bind the DataGrid control of the DataView object. C. Set the AllowSorting property of the DataGrid control to True. Set the SortExpression property of the DataGridColumn that displays ProductName to “ProductName DESC”. Bind the DataGrid control to the DataTable object. D. Set the DisplayExpression property of the DataTable object to “ORDER BY ProductName DESC”. Bind the DataGrid control to the DataTable object. |
|
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 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 |
|
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 |
|
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 |
|
You company XYZ Inc. hosts an ASP.NET application that provides customer demographic information. Some of the demographics data is presented by using images.. The target audience for the application includes a significant number of users who have low vision. These individuals use various browsers that vocalize the textual content of Web pages. These users need to receive the content of the images in vocalized form. You need to modify the application to make it accessible for your target audience. You need to accomplish this task with the minimum amount of development effort. How should you modify the application? A. Modify all ASP.NET pages in the application so that the view state is enabled. B. Modify all ASP.NET pages in the application to add custom logic that conveys the demographic information in either textual or graphical format. C. Modify all images in the application so that the ToolTip property conveys the same demographic information as the image. D. Modify all images in the application so that the AlternateText property conveys the same demographic information as the image.
|
|
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 an ASP.NET page named XYZCalendar.aspx that shows scheduling information for projects in your company. The page is accessed from various other ASP and ASP.NET pages hosted throughout the company’s intranet. All employees on the intranet use Internet Explorer. XYZCalendar.aspx has a Calendar control at the top of the page. Listed below the Calendar control is detailed information about project schedules on the data selected. When a user selects a date in the calendar, the page is refreshed to show the project schedule details for the newly selected date. Users report that after viewing two or more dates on XYZCalendar.aspx, they need to click the browser’s Back button several times in order to return to the page they were viewing prior to accessing XYZCalendar.aspx. You need to modify XYZCalendar.aspx so that the users need to click the Back button only once. What should you do? A. Add the following statement to the Page.Load event handler for XYZCalendar.aspx: Response.Expires(0); B. Add the following statement to the Page.Load event handler for XYZCalendar.aspx: Response.Cache.SetExpires (DateTime.Now()); C. Add the following attribute to the Page directive for XYZCalendar.aspx: EnableViewState=”True” D. Add the following attribute to the Page directive for XYZCalendar.aspx: SmartNavigation=”True”
|
|
View Answer |
|
Question: 11. 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 |
|
You create a reporting application for XYZ’s Travel. You create several reports, each of which resides in its own folder under the Report folder. Each subfolder has the appropriate security rights sets for Microsoft Windows users. You write a function named ListReports that generate a list of available reports. You want to configure the application and the ListReports function to find out which reports are available to the current user. If a user is logged in by using Windows authentication, you want ListReports to apply that user’s rights. If the user is not logged in by using Windows authentication, you want ListReports to use the rights granted to the XYZtravelReportingAccount user account. The password for this user accounts is “p1XYZi32” Which two actions should you take? (Each correct answer presents part of the solution. Choose two) A. Add the following element to the Web.config file: <identity impersonate=”false”> B. Add the following element to the Web.config file. <identify impersonate=”true”> C. Add the following element to the Web.config file: <identity impersonate=”true” userName=”margiestravelReportingAccount” password=” p1XYZi32”> D. Add the following element to the Web.config file: <authorization> <allow user=”XYZtravelReportingAccount”> </authorization> E. Add code to the ListReports function to create and use a WindowsPrincipal object based on the XYZtravelReportingAccount user account only if no user is authenticated. F. Add code to the ListReports function to always create and use a WindowsPrincipal object based on the XYZstravelReportingAccount user account.
|
|
View Answer |
|
You are creating an ASP.NET page for XYZ. You create a DataGrid control that displays past purchases made by the user. The DataGrid control is populated from an existing database when the page is created. The page contains TextBox controls that allow users to update their personal information, such as address and telephone number. You need to ensure that the page is refreshed as quickly as possible when users update their contact information. What should you do? A. Set the Enable property of the DataGrid control to false. B. Set the EnableViewState property of the DataGrid to false. C. Write code in the Page.Load event handler that populates the DataGrid control only when the IsPostBack property of the page is false. D. Write in the Page.Load event handler that populates the DataGrid control only when the IsPostBack property of the page is true.
|
|
View Answer |
|
You are creating an ASP.NET application for XYZ. An earlier version of the application uses ActiveX components that are written in Visual Basic 6.0. The new ASP.NET application will continue to use the ActiveX components. You want the marshaling of data between your ASP.NET application and the ActiveX components to occur as quickly as possible. Which two actions should you take? (Each correct answer presents part of the solution. Choose two) A. Use ODBC binding. B. Use late binding. C. Use early binding D. Set the AspCompat attribute of the Page directive to true. E. Set the AspCompat attribute of the Page directive to false.
|
|
View Answer |
|
You create a new ASP.NET application named XYZSalesReports on your development computer. You add code to the default WebForm1. To test the code’s functionality, you copy the entire XYZSalesReports folder from the C:inetpubwwwroot folder on your computer to the C:inetpubwwwroot folder on a separate Microsoft Windows 2000 Server computer named XYZ1. XYZ1 hosts several ASP.NET applications. When you use the browser on your computer to open the copy of the application hosted on XYZ1, you receive the following error message: “It is an error to use a section registered as allowDefinition=”MachineToApplication’ beyond application level.” You want to correct this error without altering the other Web sites that are hosted on XYZ1. What should you do? A. Use Internet Information Services (IIS) to create a virtual directory that points to the XYZSalesReports folder on XYZ1. B. Remove the following element from the Web.config file in CinetpubwwwrootXYZSalesReports on XYZ1: <authentication mode=”Windows” /> C. Remove the following element from the Web.config file in C:inetpubwwwroot on XYZ1: <authentication mode=”Windows” /> D. Move the XYZSalesReports folder on XYZ1 up one level, so that it is a subfolder of the inetpub folder.
|
|
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 |