Chinese(T) | English
contact me
User Login
Username:
Password :

Developing and Implementing Web Applications with Microsoft Visual Basic.NET

Index >> Microsoft >> MCSD.NET >> "70-305"Exam

VUE/Prometric Code:70-305

Exam Name:Developing and Implementing Web Applications with Microsoft Visual Basic.NET
Questions and Answers:181 Q&As
Price:$49
Updated:2008-11-12
Developing and Implementing Web Applications with Microsoft Visual Basic.NET
Test Q&A Updated Price
70-305 181 Q&A 2008-11-12 $49

please download in PDF format Demo: 70-305

killtest 70-305 Exam Features

High quality and Value for the 70-305 Exam.
Killtest Practice Exams for Developing and Implementing Web Applications with Microsoft Visual Basic.NET 70-305 are written to the highest standards of technical accuracy, using only certified subject matter experts and published authors for development.

100% Guarantee to Pass Your MCSD.NET exam and get your MCSD.NET Certification.
We guarantee your success in the first attempt. If you do not pass the 70-305 (Developing and Implementing Web Applications with Microsoft Visual Basic.NET) on your first attempt we will give you a FULL REFUND of your purchasing fee AND send you another same value product for free.

killtest 70-305 Downloadable.
Printable Exams (in PDF format) Our Exam 70-305 Preparation Material provides you everything you will need to take your MCSD.NET exam. The MCSD.NET Certification details are researched and produced by Professional Certification Experts who are constantly using industry experience to produce precise, and logical. You may get MCSD.NET exam questions from different web sites or books, but logic is the key. Our Product will help you not only pass in the first MCSD.NET exam try, but also save your valuable time .

  • Comprehensive questions with complete details about 70-305 exam.
  • 70-305 exam questions accompanied by exhibits.
  • Verified Answers Researched by Industry Experts and almost 100% correct.
  • Drag and Drop questions as experienced in the Real MCSD.NET exam.
  • 70-305 exam questions updated on regular basis.
  • Like actual MCSD.NET Certification exams, 70-305 exam preparation is in multiple-choice questions (MCQs).
  • Tested by many real MCSD.NET exams before publishing.
  • Try free MCSD.NET exam demo before you decide to buy it in http://www.Killtest.com.

High quality and Value for the 70-305 Exam:100% Guarantee to Pass Your MCSD.NET exam and get your MCSD.NET Certification.

http://www.Killtest.com The safer.easier way to get MCSD.NET Certification.

We offer Demo version of Q&A, Q&A are as follows (not to provide picture):

70-305:please download 70-305 in PDF format Demo 70-305

1. You create an ASP.NET application for your company. Your application contains a method named nextBusinessDay. This method uses a date parameter and returns the next date that is not a holiday or weekend day. You are debugging a page named ProjectTimeline.aspx. You need the execution to break on the following line of code when the value of the dStartDate variable changes: dStartDate = nextBusinessDay(dStartDate) What should you do?
A. Set a breakpoint on the line of code and open the BreakPoint Properties dialog box. Specify the following breakpoint condition: dStartDate <> dStartDate Select the is true option.
B. Set a breakpoint on the line of code and open the BreakPoint Properties dialog box. Specify the following breakpoint condition: dStartDate Select the has changed option.
C. Add the following statement immediately after the call to nextBusinessDay: System.Diagnostics.Debug.Assert( _ dStartDate <> dStartDate, "dStartDate has changed.")
D. Add the following statement immediately after the call to nextBusinessDay: System.Diagnostics.Trace.Assert( _ dStartDate <> dStartDate, "dStartDate has changed.") Answer: B

2. You are creating an ASP.NET page for your company. The page contains a DataGrid control that displays all the current prices for the commodities that the company purchases. The page also contains a Button control that refreshes the data in the DataGrid control. The DataGrid control needs to be repopulated each time the page is displayed. The data is accessed through a DataView object stored in the Session object. You want to ensure the fastest load time for the page. What should you do?
A. Set the DataSource property and call the DataBind method of the DataGrid control in the Click event handler for the Button control.
B. Set the DataSource property and call the DataBind method of the DataGrid control in the Start event handler for the Session object.
C. Set the EnableViewState property of the DataGrid control to false.
D. Set the EnableViewState property of the DataGrid control to true.
Answer: C

3. You are configuring security for your ASP.NET application. The folders for your pages are located in a hierarchy as shown in the exhibit. (Click the <<ItemExhibitName>> button.)                                  
You need to allow all users to access pages located in the Products folder and the Orders folder. You need to allow only members of the Accounting role to access pages located in the Accounting folder. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. Add code to the Global.asax file to dynamically configure access to the Accounting folder.
B. Place the authorization settings for all roles in the Web.config file located in the Products folder. Use the location tag in the Web.config file to deny access to the Accounting folder for all roles except the Accounting role.
C. Place the authorization settings for all roles in the Web.config file located in the Products folder. Allow access for only members of the Accounting role in the Web.config file located in the Accounting folder.
D. Create two custom roles in the Machine.config file for the application. Configure one role for all users, and one role for the Accounting users. Deny access to the Accounting folder for all users except members of the Accounting role.
Answer: BC

4. You are maintaining an ASP.NET application named SalesForecast. The application is written in Visual Basic .NET. The application includes a page named FirstQuarter.aspx that resides within the Sales namespace. The page class is named FirstQuarter. You discover that another developer inadvertently deleted the Page directive for FirstQuarter.aspx. You want to create a new Page directive to allow FirstQuarter.aspx to work properly. Which directive should you use?
A. <%@ Page Language="vb" Codebehind="FirstQuarter.aspx.vb" Inherits="FirstQuarter"%>
B. <%@ Page Language="vb" Codebehind="FirstQuarter.aspx.vb" ClassName="Sales.FirstQuarter"%>
C. <%@ Page Language="vb" Codebehind="FirstQuarter.aspx.vb" Inherits="Sales.FirstQuarter"%>
D. <%@ Page Language="vb" Codebehind="FirstQuarter.aspx.vb" ClassName="Sales.FirstQuarter" Inherits="FirstQuarter"%>
Answer: C

5. You are creating an ASP.NET page for a bookstore. You want the page to display a list of authors in a DataGrid control named Authors. You write a method named BindAuthors() to bind Authors to a DataView object at run time. You enable paging for the grid. You place two Label controls on the page. One control is named Current, and the other control is named Total. In the Current label, you want to display the page number of the current page. In the Total label, you want to display the total number of pages that are available. You need to ensure that these controls are updated whenever a user moves from page to page in the grid. You are writing the following event handler for the Authors.PageIndexChanged event. (Line numbers are included for reference only.) 1 Private Sub HandlePage(sender As Object, _ e As DataGridPageChangedEventArgs) _ Handles Authors.PageIndexChanged 2 Authors.CurrentPageIndex = e.NewPageIndex 3 BindAuthors() 4 5 End Sub Which code should you add at line 4 of the event handler?
A. Current.Text = (Authors.PageCount + 1).ToString() Total.Text = (Authors.PageSize).ToString()
B. Current.Text = (Authors.CurrentPageIndex _ + 1).ToString() Total.Text = (Authors.PageSize).ToString()
C. Current.Text = (Authors.CurrentPageIndex _ + 1).ToString() Total.Text = Authors.PageCount.ToString()
D. Current.Text = (Authors.CurrentPageIndex).ToString() Total.Text = (Authors.PageCount).ToString()
Answer: C

6. You are creating an ASP.NET page for your company's Web site. Customers will use the ASP.NET page to enter payment information. You add a DropDownList control named cardTypeList that enables customers to select a type of credit card. You need to ensure that customers select a credit card type. You want a default value of Select to be displayed in the cardTypeList control. You want the page validation to fail if a customer does not select a credit card type from the list. What should you do?
A. Add a RequiredFieldValidator control and set its ControlToValidate property to cardTypeList. Set the InitialValue property of the RequiredFieldValidator control to Select. B. Add a RequiredFieldValidator control and set its ControlToValidate property to cardTypeList. Set the DataTextField property of the cardTypeList control to Select.
C. Add a CustomValidator control and set its ControlToValidate property to cardTypeList. Set the DataTextField property of the cardTypeList control to Select.
D. Add a RegularExpressionValidator control and set its ControlToValidate property to cardTypeList. Set the ValidateExpression property of the RegularExpressionValidator control to Select.
Answer: A

7. You are maintaining an ASP.NET application for your company's human resources department. The application includes a DataGrid control named employeesGrid that is bound to a DataView object named employeesView. The employeesView object is stored in the Session object. The Page.Load event handler for your Web Form includes the following code: employeesGrid.DataSource=Session("employeesView") employeesGrid.DataBind() When the user enters the name of an employee in a TextBox control named filterName and then clicks a Button control named filterButton, you want to filter the data in employeesGrid based on the name entered. Which code segment or segments should you include in the Click event handler for filterButton? (Choose all that apply.)
A. Ctype(Session("employeesView"), _ DataView).RowFilter= _ "Name='" & filterName.Text & "'"
B. Ctype(Session("employeesView"), _ DataView).RowStateFilter= _ "Name='" & filterName.Text & "'"
C. Ctype(Session("employeesView"), _ DataView).RowFilter= _ filterName.Text
D. employeesGrid.DataSource=Session("employeesView")
E. employeesGrid.DataBind()
F. employeesGrid.Dispose()
Answer: ADE

8. You create a Web custom control named Toggle that users can turn on and off. The Toggle 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 Toggle class so that when toggleButton is clicked, pages that contain instances of Toggle can process custom event handling code. You add the following code to the Toggle class: Public Event ChangedValue(sender As Object, e As EventArgs) Protected OnChangedValue(e As EventArgs) RaiseEvent ChangedValue(Me, e As EventArgs) End Sub You need to add code to toggleButton_Click so that pages that contain instances of Toggle can handle the ChangedValue event and process custom event handling code. Which code should you use?
A. AddHandler sender.click, AddressOf ChangedValue
B. AddHandler sender.Click, AddressOf OnChangedValue
C. OnChangedValue(EventArgs.Empty)
D. ChangedValue(Me, EventArgs.Empty)
Answer: C

9. You are creating an ASP.NET application that uses role-based security to allow users to access only those pages that they are authorized to access. You use a Microsoft SQL Server database to manage the lists of users and roles for the ASP.NET application. A table named Roles contains a column named RoleID and a column named RoleName. A table named Users contains a column named UserID, a column named UserName, and a column named Password. A table named UserRoles contains a column named UserID and a column named RoleID. You need to create a stored procedure that returns all users who belong to a specified role. You write the following Transact-SQL code to define the stored procedure: CREATE PROCEDURE GetRoleMembers @RoleID int AS Which code segment should you use to complete the stored procedure?
A. SELECT UserRoles.UserID, Users.UserName FROM Users INNER JOIN Roles UserRoles On UserRoles.RoleID = Users.UserID WHERE UserRoles.RoleID = @RoleID B. SELECT UserRoles.UserID, Users.UserName FROM UserRoles INNER JOIN Roles On UserRoles.RoleID = Roles.RoleID, Users WHERE UserRoles.RoleID = @RoleID
C. SELECT UserRoles.UserID, Users.UserName FROM UserRoles INNER JOIN Users On Users.UserID = UserRoles.UserID WHERE UserRoles.RoleID = @RoleID
D. SELECT Users.UserID, Users.UserName FROM Users, UserRoles INNER JOIN Roles On UserRoles.RoleID = Roles.RoleID WHERE UserRoles.RoleID = @RoleID
Answer: C
 
10. You are using Visual Studio .NET to create an ASP.NET application for your company's intranet. Your company's sales representatives will use your application to enter telephone orders from customers. Your application uses an XML Web service for credit card verification. The XML Web service contacts a third-party credit card processing service to authorize credit card charges. Your application also uses several Microsoft SQL Server stored procedures. The stored procedures were created by your company, and they are used by several other applications. You have access to the source code for the XML Web service and the stored procedures. Before you deliver your application for comprehensive testing, you need to perform unit testing to ensure that the application performs as intended. Which three courses of action should you include in your unit test plan? (Each correct answer presents part of the solution. Choose three.)
A. Use the T-SQL Debugger to step through each stored procedure used by your application and ensure that each stored procedure is functioning properly.
B. Add the source code for the XML Web service to your Visual Studio .NET solution. Use the Visual Studio debugger to step through calls to this code.
C. Ensure that your application is functioning properly when using various application parameters.
D. Examine and validate the input parameters, output parameters, and results from each call to the stored procedures.
E. Examine and validate the values sent to and received from the XML Web service.
F. Contact the third-party credit card processing service to verify that credit card charges issued by your application are being delivered properly by the XML Web service.
Answer: CDE

11. You deploy an ASP.NET application on the Internet. One page of the application is named AccountInfo.aspx. This page contains client-side validation code that is different depending on the value of the User-Agent HTTP header field. The Web.config file for your application includes the following Trace element: <trace enabled="false" requestLimit=10 pageOutput="false" tracemode="SortByTime" localOnly="true" /> Some users report that they receive an error message in the client-side validation code when using Internet Explorer 5.01. You need to examine the value of the User-Agent HTTP header field when a request is made by this browser version. You need to accomplish this task with the least impact to the users of the application. What should you do?
A. Modify the enabled attribute in the Trace element of the Web.config file as follows: enabled="true"
B. Add the following attribute to the Page directive for AccountInfo.aspx: Trace="true"
C. In AccountInfo.aspx, add Response.Write statements that return the HTTP header information.
D. In AccountInfo.aspx, add Debug.Print statements that return the HTTP header information.
Answer: A

12. You create an ASP.NET application and deploy it on a test server. 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. Answer: ABE

13. You are working on a development team for a pharmaceutical company. Your team is creating an ASP.NET application named DrugInformation that records and analyzes pharmaceutical research data. The DrugInformation application calls a component named DrugAnalysis. The DrugInformation application contains the source code for the DrugAnalysis component. You enable tracing with page output for each page in DrugInformation. While you are testing DrugInformation, you discover that the DrugAnalysis component sometimes returns unexpected results. You want to add tracing to the DrugAnalysis component. You want the trace output from DrugAnalysis to appear along with the rest of the trace output at the bottom of each ASP.NET page that uses DrugAnalysis. What should you do?
A. Instantiate the System.Web.HttpContext.Current class within DrugAnalysis.
B. Instantiate the System.Web.HttpWriter.Synchronized class within DrugAnalysis.
C. Instantiate the Trace class within DrugAnalysis and write trace information to the default trace listener.
D. Instantiate the Debug class within DrugAnalysis and write trace information to the default debug listener.
Answer: A

14. You create an ASP.NET application named MyProject on your client computer. The application has a page named ProjectCalendar.aspx. This page is located in a virtual directory named Scheduling, which is a child of the MyProject root directory. ProjectCalendar.aspx uses cookies to track modifications to the schedule during a user's session so that the user can undo modifications if necessary. You deploy your application on a computer named Server1. Users report that the undo functionality stops working after they execute a specific sequence of actions. You need to view the cookie values after the sequence of actions to help identify the cause of the problem. You add the following element to the Web.config file: <trace enabled="true" pageOutput="false" /> You want to display the trace output information on your client computer. Which URL should you use? A. HTTP://Server1/MyProject/Scheduling/ProjectCalendar.aspx?Trace=true
B. HTTP://Server1/MyProject/Scheduling/ProjectCalendar.aspx?trace.axd
C. HTTP://Server1/MyProject/Scheduling/ProjectCalendar.aspx
D. HTTP://Server1/MyProject/Scheduling/trace.axd
E. HTTP://Server1/MyProject/ProjectCalendar.aspx?trace.axd
F. HTTP://Server1/MyProject/trace.aspx
Answer: D

15. Your company is developing an ASP.NET application for producing comparative insurance quotes from multiple insurance carriers. The company 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 your company'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 carriers are being displayed on the quote results 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"
Answer: CD

16. Your project team develops an ASP.NET application. Your code includes an Import System.Diagnostics statement. Each team member uses the Write method of both the Debug and Trace classes of the System.Diagnostics namespace to provide information on the application execution to any defined listeners. You are performing the integration testing for the application. You need to ensure that only one entry is added to the event log each time a call is made to the Write method of either the Debug class or the Trace class. Which code segment or segments are possible ways to achieve this goal? (Choose all that apply.)
A. Dim myTraceListener As New _ EventLogTraceListener("myEventLogSource") System.Diagnostics.Trace.Listeners.Add(myTraceListener)
B. Dim myDebugListener As New _ EventLogTraceListener("myEventLogSource") System.Diagnostics.Debug.Listeners.Add(myDebugListener)
C. Dim myTraceListener As New _ EventLogTraceListener("myEventLogSource") System.Diagnostics.Debug.Listeners.Add(myTraceListener) System.Diagnostics.Trace.Listeners.Add(myTraceListener)
D. Dim myDebugListener As New _ EventLogTraceListener("myEventLogSource") Dim myTraceListener As New _ EventLogTraceListener("myEventLogSource") System.Diagnostics.Debug.Listeners.Add(myDebugListener) System.Diagnostics.Trace.Listeners.Add(myTraceListener)
Answer: AB

17. You are creating an ASP.NET application for an online banking site. You need to allow customers to transfer funds between accounts. You write a component in Visual Basic .NET to handle transfers of funds. This component is used by the page named FundsTransfer.aspx. For unit testing, you add the following code segment to the TransferFunds method of your component. (Line numbers are included for reference only.) 1 Dim ctx As HttpContext 2 ctx = HttpContext.Current 3 ctx.Trace.Write("Funds transfer requested.") You want to be able to view the trace output on the FundsTransfer.aspx page. What should you do?
A. Add code to the FundsTransfer.aspx page that instantiates a Trace listener.
B. Enable tracing in the Page directive for the FundsTransfer.aspx page.
C. Add the following attribute to the Machine.config file: <trace enabled="true">
D. Modify line 3 of the code segment as follows: System.Diagnostics.Trace.WriteIf( _ ctx.IsDebuggingEnabled, "Funds transfer requested.")
Answer: B

18. You are creating an ASP.NET application for your company's accounts receivable department. One page of the application is named GenerateInvoices.aspx. This page is used to create invoices to be sent to customers. One of the business rules for your accounts receivable department is that it must never issue an invoice that has a negative balance. These invoices are handled by the accounts payable department. You add tracing instrumentation to GenerateInvoices.aspx for use during your testing and debugging phase to warn you if an invoice that has a negative invoice balance exists. The following instrumentation code segment is used to indicate when an invoice that has a negative receivable value exists: Dim negativeReceivableSwitch As New _ TraceSwitch("NegativeRec", _ "Negative Receivable Warning") If dblTotalInvoice < 0 Then If negativeReceivableSwitch.TraceWarning Then Trace.WriteLine( _ "Negative receivable invoice total encountered.") End If End If You need to see the warning message during the unit testing of GenerateInvoices.aspx. Which action or actions are possible ways to achieve this goal? (Choose all that apply.)
A. Modify the switches section of the Web.config file so that it contains the following element: <!-- Switch set to TraceError --> <add name="NegativeRec" value="1" />
B. Modify the switches section of the Web.config file so that it contains the following element: <!-- Switch set to TraceWarning --> <add name="NegativeRec" value="2" />
C. Modify the switches section of the Web.config file so that it contains the following element: <!-- Switch set to TraceInfo --> <add name="NegativeRec" value="3" />
D. Modify the switches section of the Web.config file so that it contains the following element: <!-- Switch set to TraceVerbose --> <add name="NegativeRec" value="4" />
E. Delete the section of the Web.config file that sets the value of the NegativeRec switch. F. Set your build configuration to Release mode and recompile the application.
Answer: BCD

19. You are creating an ASP.NET application for your company's human resources (HR) department. Users in the HR department will use the application to process new employees. The application automates several activities that include creating a network login account, creating an e-mail account, registering for insurance benefits, and other activities. During integration testing of your application, you need to verify that the individual activities run successfully and in the proper order. Each page in your application includes the following elements in the Page directive: Debug="True" Trace="True" You want each page to provide execution information in the Web browser immediately after the page's normal display output. You need to add instrumentation to the code in your pages to accomplish this goal. Which statement should you use?
A. Trace.Write
B. Debug.Print
C. System.Diagnostics.Trace.Write
D. System.Diagnostics.Debug.Write
E. System.Diagnostics.Debugger.Log
Answer: A

20. You are using your computer to debug an ASP.NET application. Your login account has administrative permissions for your computer. The application contains several existing ASP pages that use server-side scripts. These server-side scripts are written in Visual Basic Scripting Edition. You locate a line of VBScript code in an existing ASP page that might be incorrect. You add a breakpoint on the line. When you run the application, everything appears to work properly, but the breakpoint is not invoked. When you examine the breakpoint in the VBScript code, you see the following ToolTip: "The breakpoint will not currently be hit. No symbols have been loaded for this document." You want the breakpoint to be invoked when you run the application in Debug mode. What should you do?
A. Open the Configuration Manager and set the Active Solution Configuration option to Debug.
B. Select the ASP page in Solution Explorer. Set the Build Action property to Compile.
C. Open the property pages for the ASP.NET application and select the ASP Debugging check box.
D. Select Options from the Tools menu. Select the Debugging folder. In the General category, select the Insert breakpoints in Active Server Pages for breakpoints in client script check box.
Answer: C

21. Your company's project team develops an order fulfillment ASP.NET application. The application is hosted on a single server named Server1. You are responsible for verifying and correcting problems identified by the quality assurance team. The quality assurance team reports that freight costs are not being calculated accurately. You need to replicate the problem in order to resolve it. You attempt to use the interactive debugger from your client computer to step through the ASP.NET application code on Server1. You are not able to initiate a debugging session, and the following entry is added to the Application event log on your client computer: "DCOM got error 'General access denied error' from the computer Server1 when attempting to activate the server." You need to enable remote debugging. What should you do?
A. Add your user account to the Power Users group on your client computer.
B. Add your user account to the Power Users group on Server1.
C. Add your user account to the Debugger Users group on your client computer.
D. Add your user account to the Debugger Users group on Server1.
Answer: D

22. You create an ASP.NET application. You implement tracing and debugging instrumentation. The application is deployed on your company'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 DbgClr.exe and attach to the aspnet_wp.exe process on the production server.
Answer: C

23. You create an ASP.NET application for a consulting company. The company uses the application to perform time tracking and to generate billing invoices. The accounts receivable department uses a page named PrepareInvoices.aspx to issue invoices to clients at the end of each month. During testing of the application, you discover that some invoices are being generated with negative values for the total amount due. The total amount due is calculated within a function named CalculateTotalDue, which is defined in the PrepareInvoices.aspx page. The call to CalculateTotalDue is contained in the following code segment from PrepareInvoices.aspx. (Line numbers are included for reference only.) 1 Dim totalAmountDue As Double 2 totalAmountDue = CalculateTotalDue() 3 totalAmountDue -= totalAmountDue * discountRate You are using Visual Studio .NET to debug your application. You need to stop execution of the code within PrepareInvoices.aspx and enter the interactive debugger when CalculateTotalDue returns a negative value. What should you do?
A. Modify the code segment as follows: Dim totalAmountDue As Double totalAmountDue = CalculateTotalDue() System.Diagnostics.Debug.Assert(totalAmountDue >= 0) totalAmountDue -= totalAmountDue * discountRate
B. Modify the code segment as follows: Dim totalAmountDue As Double totalAmountDue = CalculateTotalDue() totalAmountDue -= totalAmountDue * discountRate System.Diagnostics.Debug.Assert(totalAmountDue >= 0)
C. In the Watch window, add a watch expression of totalAmountDue < 0, and select the Break When Value Is True option.
D. Set a breakpoint on line 3 of the code segment. Define a condition for the breakpoint to break when totalAmountDue < 0 is true.
E. Set a breakpoint on line 2 of the code segment. Define a condition for the breakpoint to break when totalAmountDue < 0 is true.
Answer: D

24. You are debugging an ASP.NET application that was written by other developers at your company. The developers used Visual Studio .NET to create the application. A TextBox control on one of the .aspx pages incorrectly identifies valid date values as being invalid. You discover that the validation logic for the TextBox control is located within a method that is defined in client-side code. The client-side code is written in Visual Basic Scripting Edition. You want to verify that the validation method is receiving valid input parameters when the page is running. You need to perform this task by stepping through the client-side code as it runs. Which four courses of action should you take? (Each correct answer presents part of the solution. Choose four.)
A. In Internet Explorer, clear the Disable script debugging check box in the advanced options and browse to the page that contains the client-side code.
B. In Visual Studio .NET, select Debug Processes from the Tools menu and attach to the local copy of Iexplorer.exe. In the Running Documents window, select the .aspx page that you want to debug.
C. Create a new active solution configuration named Client and copy the settings from the Release configuration. Select the new configuration in the Configuration Manager.
D. Set the following attribute in the application's Web.config file: debug="true"
E. In Solution Explorer, open the source for the .aspx file that you want to debug and select Start from the Debug menu.
F. In Visual Studio .NET, set a breakpoint or add a Stop statement in the client-side code where you want to begin interactive debugging.
G. In Internet Explorer, perform the actions that cause the client-side code to run.
Answer: ABFG

25. You use Visual Studio .NET on your client computer to develop an ASP.NET application on a remote server. The application provides asset management functionality. Another developer in your company uses Visual Basic .NET to develop a custom component named AssetManagement. Your ASP.NET application uses this custom component. The AssetManagement component defines an Assets class that exposes a public method named DepreciateAssets(). You deploy AssetManagement to the remote server that hosts your ASP.NET application. You add the source files of AssetManagement to your ASP.NET application. You are debugging an .aspx page in your application by using the Visual Studio .NET interactive debugger. The code in the page creates an instance of the Assets class and then calls the DepreciateAssets() method of that instance. You attempt to step into a call to the DepreciateAssets() method. Instead of showing the first line of code in the DepreciateAssets() method, the interactive debugger moves to the next line of code in the .aspx page. You need to enable the interactive debugger to step into the code within the Assets class. What should you do in Visual Studio .NET?
A. Configure Visual Studio .NET to enable just-in-time debugging for native programs.
B. Configure Visual Studio .NET to allow editing of Visual Basic files while debugging.
C. In the Configuration Manager, select the Debug configuration and rebuild the AssetManagement component.
D. In the Configuration Manager, select the Debug configuration and rebuild the ASP.NET application.
Answer: C

26. You create an ASP.NET application for a bank. The application provides account management functionality. A page named AccountWithdrawal.aspx contains a method named WithdrawFunds. The WithdrawFunds method is defined in the following code segment. (Line numbers are included for reference only.) 1 Private Function WithdrawFunds(Amount As Double) _ as Double 2 3 m_dAccountBalance -= Amount 4 Return m_dAccountBalance 5 End Function The callers of this method need to verify that sufficient funds exist in the account before attempting the withdrawal. During unit testing, you want to receive notification when a call is made requesting a withdrawal amount for which the account does not have sufficient funds available. You plan to build the production version of your application by using he Release Build Configuration in Visual Studio .NET. You need the testing instrumentation to be included but not enabled in the application when the application is deployed to production. You need to have the ability to enable the instrumentation after deploying it to production without requiring the application to be rebuilt. Which code should you insert at line 2 of the code segment?
A. Debug.Assert(m_dAccountBalance - Amount >= 0, _ "Insufficient funds for withdrawal.")
B. Trace.Assert(m_dAccountBalance - Amount >= 0, _ "Insufficient funds for withdrawal.") C. Debug.WriteLineIf(m_dAccountBalance - Amount >= 0, _ "Insufficient funds for withdrawal.")
D. Trace.WriteLineIf(m_dAccountBalance - Amount >= 0, _ "Insufficient funds for withdrawal.")
Answer: B

27. You create an ASP.NET application for an online shopping site. The application uses a Microsoft SQL Server 2000 database. The database contains a stored procedure named getProductsByCategory that returns all products that match a specified category code. The category code is supplied as a parameter named @ProdCode. The application includes a page named ShowProducts.aspx. You are using Visual Studio .NET to debug ShowProducts.aspx. ShowProducts.aspx uses the getProductsByCategory stored procedure to populate a DataSet object. You set a breakpoint within getProductsByCategory so that you can step through the stored procedure within the debugger. While you are debugging getProductsByCategory, you need to view the current value of @ProdCode. What should you do?
A. Open the Locals debugging window.
B. Open the Modules debugging window.
C. Add the following line of code to getProductsByCategory: Print @ProdCode Open the Output debugging window and select Debug as the source from the drop-down list box.
D. Add the following line of code to getProductsByCategory: SELECT @ProdCode As DebugOutput Open the Output debugging window and select Database Output as the source from the drop-down list box.
Answer: A

28. You are creating an ASP.NET application for an insurance company. The company will use your ASP.NET application to record insurance claims. Another development team creates a redistributable component that will be used by your ASP.NET application. The component requires several registry entries to be created during installation so that the component will run properly. The same component might be used by other ASP.NET applications in the future. The development team gives you the source code to the component as well as all of the project files for the component. You add the component project to your ASP.NET application. You need to create a deployment package for your application. You want to include the redistributable component with your deployment package. What should you do?
A. Create a setup project for the redistributable component. Create a Web setup project for your ASP.NET application.
B. Create a merge module project for your ASP.NET application. Create a setup project for the redistributable component and add the merge module for your ASP.NET application to the project.
C. Create a merge module project for both your ASP.NET application and the redistributable component. Create a Web setup project and add both merge modules to the project.
D. Create a merge module project for the redistributable component. Create a Web setup project for your ASP.NET application and add the merge module for the redistributable component to the project.
Answer: D

29. You create English, French, and German versions of your ASP.NET application. You have separate resource files for each language version. You need to deploy the appropriate resource file based on the language settings of the server. What should you do?
A. Create an installer and set the Installer.Context property for each version of your application.
B. Create an installer that has a launch condition to verify the locale settings.
C. Create an installer that has a custom action to install only location-specific files.
D. Create an installer that has an MsiConfigureProduct function to install the appropriate version.
Answer: C

30. You create an ASP.NET application for your company's intranet. You create a Visual Studio .NET Web setup project to install your application. Your application will use a Microsoft SQL Server database. This database must be created during the installation process of your application. You develop a SQL script named CustomerDB.SQL that will create the database. You add CustomerDB.SQL to the Web setup project. You need to ensure that CustomerDB.SQL runs during the installation process. What should you do? A. Add a custom action to the Web setup project. Set the source path property of the custom action to CustomerDB.SQL.
B. Add a launch condition to the Web setup project. Set the Condition property of the launch condition to CustomerDB.SQL.
C. Create a new Visual Studio .NET project that runs CustomerDB.SQL and add the project output to the Web setup project. Add a custom action to the Web setup project and configure the custom action to launch the new project during installation.
D. Create a new Visual Studio .NET project that runs CustomerDB.SQL and add the project output to the Web setup project. Add a launch condition to the Web setup project and configure the launch condition to launch the new project during installation.
Answer: C