Computer Programming Exam 1 Questions
Computer Programming Exam 1 Questions
Computer Programming Exam 1 Questions
You need to track user data, including each user's location, immediate search history, and shopping cart status. By examining the website analytics, you determine the following: * Many users have very low bandwidth connections. * Most users view 3 to 4 pages per visit. * Users visit your site for a maximum of five minutes. You want to avoid storing user information in the database. Which method should you use to collect the required statistics while optimizing application performance? 2. You are developing an ASP.NET web application that will be deployed to multiple web servers in a web farm. Which session state modes can you use to share session state across servers? (Each correct answer presents a complete solution. Choose two.) 3. You are developing an internal ASP.NET web application that will use session state. Your application will be deployed to a single web server. Some users will access your application with browsers that do not accept cookies. You need to ensure that your application will function predictably for these users. Your solution should not unnecessarily degrade performance. Which session state mode most easily meets these requirements?
Session State
4. You are creating an ASP.NET application. After users log in for the first time through the login.aspx page, they are redirected to a web form, named address.aspx, that prompts them to enter their names and addresses in a series of TextBox controls. The login.aspx page sends the username to the address.aspx form. To locate an account, you need the username. When a user fills out the address.aspx form and submits it by using a postback, his username is no longer available as a query string parameter. Many site users use Web browsers that do not support cookies. You do not want to store any information where it will be visible in the browser address bar. How can you make the username available when the user submits the address.aspx form? 5. You are developing an ASP.NET web application. The application is a news site that automatically adapts itself based on user behavior. For example, if a user frequently views sports news, sports news will appear at the top of the page when the user displays the site, even if the user does not log in to the site. You need to ensure that the application can access information about user preferences for an extended period of time. Which object should you use to accomplish this goal? 6. You are updating an ASP.NET web application. You want to display recent user comments on the page in near real-time so that new comments are visible to other users the next time they request a page. You need to do this without querying the database for recent comments. Which object should you use to accomplish this goal? 7. You are creating a custom class to store information about users when they visit your ASP.NET web application. You need to ensure that you can store an instance of the custom class in the Session object. Which interface should your custom class implement?
Application -Chapter 3
ISerializable
8. You are developing an ASP.NET web application that includes a custom user control. To improve performance, you want to use output caching to store a copy of the control's output for five minutes. The control's output is identical for different users and sessions, so you want to cache a single copy of the output for multiple users. Which directive should you use to configure the custom user control? 9. You are developing an ASP.NET web application that includes a custom user control. To improve performance, you want to use output caching at both the page level and the control level. You configure an ASP.NET webpage with the following directive: <%@ OutputCache duration="60" varybyparam="none" %> The webpage contains a user control that you configure with the following directive: <%@ OutputCache duration="30" varybyparam="none" %> How long will the user control output be cached? 10. You are creating a webpage. Though the entire page cannot be cached, you would like to enable caching for a set of controls on the page. Which solution can you use to accomplish this goal using the least amount of development effort? 11. You are developing a data-driven ASP.NET web application. You need to configure a SqlDataSource control to meet the following requirements: * Remove cached items that have not been accessed for five minutes. * Retain the most frequently used cached items for a longer period of time. Which configuration should you use?
1 Minute Chapter 2
Define the controls in an .ascx file and apply the @ OutputCache directive to the file Chapter 2
<asp:SqlDataSource ID="SqlDataSource1" EnableCaching="true" CacheExpirationPolicy="Sliding" CacheDuration="300" ConnectionString="Server=localhost;database=Items" SelectCommand="SELECT * FROM Products" Runat="server" /> -Chapter 2
12. You are developing a data-driven ASP.NET web application. You are creating a web form that displays product information. The product information is stored in a backend database that your application accesses by using a custom class named Product. When you retrieve product information from the database, you create an instance of the Product class and add it to the Cache collection. Before displaying the product information, you need to retrieve it from the Cache collection if it is available. You write the following code segment: if (Cache["MyProduct"] != null) // Display product information to user. Which action should you perform in the commented code sections? 13. You are developing an ASP.NET web application. You want to cache an object, but you want the object to expire from the cache when the SourceFile.txt file is updated. Which code segment should you use? 14. You are creating content pages that reference another developer's master page. The master page developer has exposed several public properties, including the company's street address, city, state, and phone number. You need to display the phone number (defined in the master page's PhoneNumber property) in your PhoneNumberTextBox control.
Which code segment should you use? Master.FindControl 15. Which method can you use from a content page to create a Control Chapter 2 instance representing a control on a master page? Master Page init event 16. You have an ASP.NET web application Content page init event that uses master pages and content pages. Content page load event You must initialize and close multiple Master page load event resources from different events. Content page prereader event Master page prereader event In what order do events in the master pages
and content pages occur? -Chapter 2 In the list on the right, select the event. Place your selections in the list on the left in the order in which the events occur. Place your selections in the list on the left by clicking the items in the list on the right and clicking the arrow button. You can also use the up and down buttons to rearrange items in the list on the left. You may not need to use all of the items from the list on the right. 17. Which declaration is valid for a nested master file? 18. You want to enable users to switch between multiple page themes by creating multiple master pages and allowing content pages to select a master page dynamically based on user preferences. Which of the following are requirements for dynamically changing master pages? (Choose three.) 19. Which code segment can you use to modify the content of a Label control located on a master page? 20. You are developing an ASP.NET website that uses multiple layers of themes. You want to ensure that attributes will be correctly applied to controls when multiple themes specify the same control attribute. What is the order of precedence that defines how ASP.NET applies themes? In the list on the right, select the theme declaration. Place your selections in the list on the left in the order in which ASP.NET applies the theme declarations. Place your selections in the list on the left by clicking the items in the list on the right and clicking the arrow button. You can also use the up and down buttons to rearrange items in the list on the left. You may not need to use all of the items from the list on the right. 21. Which theme declarations would override settings in the local controls? (Choose two.)
<%@ Master Language="C#" master="Blue.master"%> -Chapter 2 - All master pages must have public properties for those accessed by the content page. - All master pages must have the same ContentPlaceHolder controls. - The desired master page must be defined in the content page's Page_PreInit method. Chapter 2 Label _CurrentPage = (Label)Master.FindControl("CurrentPage"); _CurrentPage.Text = "About" Chapter 2 1. Theme attribute in the "@ Page" directive. 2. <pages Theme="themeName"> element in the Web.config file. 3. Local control attributes. 4. StyleSheetTheme attribute in the "@ Page" directive. 5. <pages StyleSheetTheme="themeName"> element in the Web.config file. Chapter 2
1. The Theme attribute in the "@ Page" directive. 2. The <pages Theme="themeName"> element in the Web.config file.
22. You want to apply a theme only to the control attributes on an ASP.NET webpage which you have not specifically defined. Which page declaration should you use? 23. Your team is developing an ASP.NET website. You want to give developers the option to apply a skin to Button controls, but you do not want the skin applied automatically. Which skin file code segment should you use? 24. You need to programmatically apply a theme named Fabrikam to control attributes that have not already been defined on a page. You do not want the theme to override defined control attributes. Which code segment should you use? 25. You create an ASP.NET web form. In Microsoft Visual Studio 2010 you use the designer to specify text for all controls in English and German. You are using implicit localization. Where does Visual Studio store the German language text? 26. You create an ASP.NET webpage named MyPage.aspx. In Microsoft Visual Studio 2010, you use the designer to specify text for all controls in English. In Visual Studio, you click the Tools menu and then click Generate Local Resource. You want to use implicit localization to provide culturally neutral French-language text for the controls to any users who have the language preference in their browser set to French. Which solution can you use to accomplish this goal? 27. You create an ASP.NET webpage named MyPage.aspx. You then create the App_GlobalResources folder, and files named LocalizedText.resx, LocalizedText.fr.resx, and LocalizedText.es.resx. You populate each LocalizedText file with a String named Login that contains a version of the phrase, "Log in
Chapter 2 <%@ Page StyleSheetTheme="MyTheme" %> Chapter 2 <asp:Button runat="server" SkinID="MySkin" BackColor="lightblue" ForeColor="black" /> Chapter 2 public override String StyleSheetTheme { get { return "Fabrikam"; } Chapter 2 In an XML resource file Chapter 6
In the App_LocalResources folder, make a copy of the MyPage.aspx.resx file named MyPage.aspx.fr.resx. Then translate the control text in the new file into French. Chapter 6
to access your preferences" in English, French, and Spanish. You add a Label control to your MyPage.aspx form. You want to display the phrase in the language that matches the language settings in the user's browser. Which code segment should you use? 28. You need to programmatically load and display a user control from an ASP.NET webpage. The webpage includes a PlaceHolder object named PlaceHolder1. Which code segment should you use? <%@ Page Language="C#" %> <%@ Reference Control="~/Controls/MyControl.ascx" %> <script runat="server"> private ASP.MyControl MyControl1; protected void Page_Load(object sender, EventArgs e) { MyControl1 = (ASP.MyControl)LoadControl("~/Controls/MyControl.asc x"); PlaceHolder1.Controls.Add(MyControl1); } Chapter 3 In the user control, store the property in ViewState. In the control's Page_Load method, read the value from ViewState if the request is a postback, and use the value to redefine the property. Chapter 3 PlaceHolder Chapter 3
29. You create a user control. You need to ensure that a custom property you created is maintained through multiple postbacks of the parent web form. Which solution would accomplish this goal most efficiently? 30. In Microsoft Visual Studio 2010, you are using the designer to create an ASP.NET web form. You need to add specific controls to the form only for users who identify themselves as managers. You're not concerned about page caching. Which control type should you use to dynamically add a control? 31. You need to initialize values in an ASP.NET web form before the form is displayed in the user's browser. To which event should you respond? 32. You need to initialize user-specific objects when a user connects to your web application for the first time. To which event should you respond?
33. You need to explicitly force a resource to be released when your web application closes. To which event should you respond? 34. You need to close a database connection that is used through the lifecycle of an ASP.NET webpage. Which event handler should you use? 35. In which order does ASP.NET raise page events? In the list on the right, select the page events. Place your selections in the list on the left in the order in which ASP.NET raises the events. Place your selections in the list on the left by clicking the items in the list on the right and clicking the arrow button. You can also use the up and down buttons to rearrange items in the list on the left. You may not need to use all of the items from the list on the right. 36. Which file should you edit to change a configuration setting for a single web application? 37. You are deploying multiple web applications created by different companies on a single web server. You want to place specific restrictions on all web applications running on that server. Which file would you edit to change a configuration setting for all web applications? 38. You recently updated an ASP.NET 2.0 web application to ASP.NET 4.0. After deploying the updated application, a webpage that allows users to submit JavaScript updates to an ASP.NET web service no longer works correctly. When users submit JavaScript updates, ASP.NET 4.0 returns the error message "A potentially dangerous value was detected from the client."
Application_End Chapter 3 Page.Unload Chapter 3 Page_PreInit Page_Init Page_Load Page_PreRender Page_Unload. Chapter 3
Add the following setting to the Web.config file: <httpRuntime requestValidationMode="2.0" /> Chapter 1
Which solution can you use to resolve the problem and minimize security risks? 39. You are creating a webpage that includes a args.IsValid = DateTime.TryParseExact(args.Value, "d", null) CustomValidator control. You add the following event handler to the control's Chapter 5 ServerValidate event: protected void
CustomValidator1_ServerValidate(ob ject source, ServerValidateEventArgs args) { // Add code here. } Which code segment can you use to verify that date input can be parsed into a DateTime object? 40. You need to ensure that web form users enter content into a TextBox control named Address before submitting the form. Which solution should you use to accomplish this goal with the least amount of development effort? 41. You need to add a control to validate that a user enters a telephone number into a TextBox control in a valid format. Which control should you use to accomplish this goal with the least amount of development effort? 42. You need to add a control to validate that a user enters a value into a TextBox control that matches a value contained in a database. Which control should you use? 43. Your web form uses standard and custom Validator controls. To reduce the risk of a malicious user bypassing client-side validation, you need to check that the form passed validation in a Button.Click handler method. Which solution should you use to validate the form input with the least amount of development effort? 44. You are creating a webpage that enables users to change their passwords. The webpage includes a ChangePassword control. Which control can you use to display an informational message to users if they enter incorrect information in the ChangePassword control? 45. You add a CustomValidator control to a webpage to validate the contents of a
Add a RequiredFieldValidator control to the web form. Set the RequiredFieldValidator.ControlToValidate property to the ID of the TextBox control. Then set the RequiredFieldValidator.ErrorMessage property. Chapter 5 RegularExpressionValidator Chapter 5
ValidationSummary Chapter 5
TextBox. You need to add client script to perform partial validation. Which steps must you complete to achieve this goal? (Each correct answer presents part of the solution. Choose two.) 46. You add a CustomValidator control to a webpage to verify that a user enters a valid date value into a TextBox. You add the following JavaScript function to your page to perform client-side validation. <script language="javascript"> function validateDate(oSrc, args) { var iDay, iMonth, iYear; var arrValues; arrValues = args.Value.split("/"); iMonth = arrValues[0]; iDay = arrValues[1]; iYear = arrValues[2]; var testDate = new Date(iYear, iMonth - 1, iDay); if ((testDate.getDate() != iDay) || (testDate.getMonth() != iMonth - 1) || (testDate.getFullYear() != iYear)) { // Add code to indicate that validation failed. } return true; } </script> You need to add code to the if block in place of the comment, to indicate that client-side validation failed. Which action should the code perform? 47. You are developing a web form that includes several controls for users to input data. The form includes Validator controls that will perform client-side validation to verify the input. You need to display error messages next to the control that caused the validation
Chapter 5
error without changing the layout of the page. Which method should you use to display an error message next to a control that causes a validation error without changing the page layout? 48. You are creating a custom control. Your control must output raw HTML and provide rich design-time support. Which method should you use to create the control? 49. You are creating an ASP.NET web form. You use the following code segment to dynamically add a Label control to a PlaceHolder named PlaceHolder1: protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Label Label1 = new Label(); Label1.Text = "Sample Label"; Label1.ID = "Label1"; PlaceHolder1.Controls.Add(Label1); } } The Label control uses ViewState. When you submit the form, the dynamically added controls disappear. Which solution will prevent the controls from disappearing when you submit the form? 50. You are creating an ASP.NET webpage. Which directive should you use to ensure that your page can reference a user control defined in an .ascx file? 51. You will use Microsoft Visual Studio 2010 to create an ASP.NET web application. You want to rely on ASP.NET dynamic compilation for iterative modifications instead of forcing a complete website rebuild. You need to create a project or website that will ensure this behavior.
Create a control that extends the WebControl class and override the Render method. Chapter 4 Always create and add the label, not only when IsPostBack is false. Chapter 5
@ Register Chapter 7 A website based on the ASP.NET Web Site template Chapter 1
Which project or website should you create? 52. You will use Microsoft Visual Studio 2010 to create an ASP.NET web application. You want to control the project's structure, namespaces, and compilation. You need to create a project or website that will ensure this behavior. Which project or website should you create? 53. You are using Microsoft Visual Studio 2010 to develop an ASP.NET web application. You want to reference a custom component that you have installed in the global assembly cache (GAC). You need to add to your project in such a way that you can still use XCOPY to deploy your application. What should you do? 54. You are creating an ASP.NET webpage that shows information about your organization's employees. If a user is logged in and a member of the Managers role, you want to display a hyperlink to a protected page from which the manager can edit details about the employee. The hyperlink is disabled by default. Which method can you use to determine whether to enable the hyperlink? (Each correct answer presents a complete solution. Choose two.) 69. You are implementing a page with AutoEventWireup enabled. You must implement a strategy to catch all unhandled page exceptions. Your strategy should not handle exceptions thrown by other pages. What should you do? 70. You are developing a web application. You want developers executing the application on the local host to see detailed descriptions of any unexpected errors. All other users should see a generic error page. What should you do? (Each correct answer presents part of the solution. Choose two.) 71. You are developing a web application. You must configure the application's Web.config
Manually add the assembly to the application's Bin folder and reference the assembly in the Bin folder. Chapter 1
Add a custom error in the <customErrors> element of the application's Web.config file. Set the <customErrors> mode attribute to RemoteOnly.
Chapter 8
<customErrors mode="On"
file to do the following: * Display a page named PageNotFound.aspx if a page causes a 404 error. * Display a page named Error.aspx if any other page error occurs. Which configuration should you use? 72. You are deploying a web application. The application includes several methods that are defined for debug purposes only. These methods are marked with a ConditionalAttribute that specifies the debug condition. You rely on dynamic compilation when you deploy the application. You need to ensure that methods marked with the ConditionalAttribute are compiled and used. Which configuration should you use? 73. You are developing a web application. You implement an Application.Error event handler to examine unhandled application exceptions. The code handles some errors, but not all. You must ensure that custom error configuration does not cause a redirection for errors that the code handles. Custom errors should display as configured for errors the code does not handle. What should you do? 74. You are creating a webpage. You must indicate a target for redirection if an unhandled page exceptions occurs. Your solution should require minimal developmental effort. What should you do? 75. You are creating a composite server control that includes a label, a text box, and a button. You need to persist properties containing information about the control's state, including the user's preferences, which aren't standard properties of the child controls. How can you do this? (Each correct answer presents a complete solution. Choose two.) 76. You are developing a custom server control that contains a text box, a label, and a button. You need to choose the most appropriate base class for the control.
defaultRedirect="~/Error.aspx"> <error statusCode="404" redirect="~/PageNotFound.aspx" /> </customErrors> Chapter 8 <compilation defaultLanguage="VB" debug="true"> </compilation> Chapter 8
In the Application_Error method, call the Server.ClearError method for errors that the code handles.
Chapter 8
Chapter 8 - Override the LoadViewState event. - Override the SaveViewState event. Chapter 7
CompositeControl Chapter 7
Which class should you choose? 77. You are creating a custom server control that defines a property named Text and derives from the WebControl class. When the control is rendered, the Text property is displayed on a web form. You need to ensure that developers using the control can define the Text property, and that the Text property stays constant even if the web form is submitted by a user multiple times. Developers should not need to write code to persist the state. Which implementation meets the requirements while allowing developers to reliably change the Text property? 78. You are creating a custom web server control that derives from the WebControl base class. In which method should you draw the HTML that displays the visible component of the control? 79. You need to use a custom server control declaratively in a web form. The control is located in the My.Controls namespace. Which Web.config file enables you to declare the control with the myControls tag prefix?
In the Set property method, write the value to ViewState. In the Get property method, read the value from ViewState. Chapter 7
RenderContents Chapter 7
<?xml version="1.0"?> <configuration> <system.web> <pages> <controls> <add tagPrefix="myControls" namespace="My.Controls"> </add> </controls> </pages> </system.web> </configuration> Chapter 7
80. You need to use a custom server control declaratively in a web form. The control is located in the My.Controls namespace in the myControls.dll assembly. Which page directive enables you to declare the control with the myControls tag prefix? 81. You create two classes of a custom server
control: myControl, which derives from CompositeControl, and myControlDesigner, which derives from CompositeControlDesigner. In Microsoft Visual Studio 2010, you want to provide support for using the control in the designer. You need to associate the myControl class with the myControlDesigner class. Which code segment should you use? 82. You are creating a composite server control that includes a label, a text box, and a button. You need to allow developers who implement the control to examine and update the label text after the control has been created. What is the appropriate way to do that? 83. Which of the following is NOT a true statement about user controls? 84. You create a user control named MyShape that displays shapes when added to a web form. You define a property named Shape in the user control. You need to add the user control to a web form. Which method should you use to specify the value of the Shape property? 85. In a user control, you need to define properties that developers can read from and write to in order to adjust the behavior of the user control. What should you do? (Each correct answer presents a complete solution. Choose two.) 86. You create a user control. You need to choose the most efficient method of maintaining a property through multiple postbacks of the parent web form. Which method should you choose? 87. Which tasks must you perform to convert a single-file ASP.NET webpage into a user control? (Each correct answer presents part of the solution. Choose five.)
Create a property in the composite control. Use the Get method to retrieve the child control's property and use the Set method to define the child control's property. Chapter 7
User controls can run as standalone files. Chapter 7 <uc1:MyShape id="MyShape" Runat="server" Shape="circle" /> Chapter 7
-Define properties with Get and Set property methods. -Define public properties. Chapter 7 In the user control, store the property to ViewState. In the control's Page_Load method, read the value from ViewState if the request is a postback and use it to redefine the property. Chapter 7 - Change the @ Page directive to @ Control. - Include a className attribute in the @ Control directive. - Change the file extension from .aspx to .ascx. - Remove all attributes of the @ Control directive except Language, AutoEventWireup (if present), CodeFile, and Inherits. - Remove the <html>, <body>, and <form> elements from
88. You need to programmatically reference a user control at run time. Which of the following must be true? (Each correct answer presents part of the solution. Choose two.) 89. You need to programmatically load and display a user control from an ASP.NET webpage. A PlaceHolder object named PlaceHolder1 exists. Which code segment should you use?
the page. Chapter 7 -The @ Control directive in the user control contains a ClassName attribute. -The ASP.NET webpage in which the control will be created contains an @ Reference directive. Chapter 7 <%@ Page Language="C#" %> <%@ Reference Control="~/Controls/MyControl.ascx" %> <script runat="server"> private ASP.MyControl MyControl1; protected void Page_Load(object sender, EventArgs e) { MyControl1 = (ASP.MyControl)LoadControl("~/Controls/MyControl.asc x"); PlaceHolder1.Controls.Add(MyControl1); } Chapter 7 - Programmatically set the WebPartManager.DisplayMode property. - Add a CatalogZone control. Chapter 5
90. You are developing an application that uses web parts. You want to enable users to switch among Browse, Design, and Catalog modes. Which task must you perform to enable this functionality? (Each correct answer presents part of the solution. Choose two.) 91. You intend to connect two web parts so that one web part displays data based on user input specified in the other web part. You will programmatically configure the connection. Which tasks must you perform to enable two web parts to share data? (Each correct answer presents part of the solution. Choose two.) 92. Another developer has created a connection provider web part that exposes a list of stock tickers that the user chooses to monitor. You would like to retrieve the list so that you can display a graph based on stock data. The following is the provider method declaration: [ConnectionProvider("Stock symbol provider", "StockProvider")] public string GetStockSymbols() {
In the web part retrieving the data, add a method that retrieves the data to be shared and specify the ConnectionConsumer attribute for the method. In the web part sharing the data, add a method that exposes the data to be shared and specify the ConnectionProvider attribute for the method.
Chapter 5 [ConnectionConsumer("Stock symbol provider", "StockConsumer")] public void GetStockSymbols() { // Method logic } Chapter 5
// Method logic return Symbols; } Which method declaration should you use to retrieve data from the web part? 93. You are creating an ASP.NET webpage that uses web parts. You need to configure a static connection between a web part named CollectPostalCode that collects the user's postal code and a web part named CalculateShipping that provides shipping costs based on the user's postal code. Which code segment should you use to connect the web parts?
<asp:WebPartManager ID="WebPartManager1" runat="server"> <StaticConnections> <asp:WebPartConnection ID="conn1" ProviderID="CollectPostalCode" ProviderConnectionPointID="PostalCodeProvider" ConsumerID="CalculateShipping" ConsumerConnectionPointID="PostalCodeConsumer" /> </StaticConnections> </asp:WebPartManager>
94. You are creating an ASP.NET website that uses web parts. You need to choose the most efficient method of allowing website administrators to edit web parts on a page so that edits are visible to all users. Which method should you choose? 95. You are creating a custom server control that derives from the Label control and displays the text stored in the Text property when the control is rendered. The text might include less than (<) or greater than (>) symbols. You want to ensure that those symbols are displayed in the browser and not rendered as HTML. Which implementation of RenderContents should you use? 96. You are creating an ASP.NET webpage that uses the Login control to collect user credentials. The Login1 control is functioning properly, but the background color defined in the .css file is not taking effect. You examine the HTML source code of the rendered page, shown in the exhibit. Which method should you use to allow the styles defined by the .css file to control the
Chapter 5 Add an <allow verbs="enterSharedScope"> element to the <system.web><authorization> section of the Web.config file. Chapter 5 protected override void RenderContents(HtmlTextWriter writer) { writer.WriteEncodedText(Text); } Chapter 7
appearance of the wizard as expected? 97. You are upgrading an ASP.NET 3.5 application to ASP.NET 4.0. You use the automated tools built into Microsoft Visual Studio 2010 to perform the upgrade process, and the application seems to work correctly. While examining the rendered HTML to verify compatibility with the latest standards, you notice some HTML that was not present in your natively developed ASP.NET 4.0 applications. Specifically, Table and Image controls have a border="0" property, even though the border property is not defined. You add the same controls to a native ASP.NET 4.0 application, and the border property does not appear in the rendered HTML. Which method should you use to remove the border property from the upgraded application? 98. You develop an ASP.NET web application and add a web setup project. During the setup process, you prompt the user to enter a user name and password in a custom dialog box you created in the user interface editor. The dialog box properties are configured as shown in the exhibit. You need to pass the dialog box properties as arguments to a custom action. Which approach should you use? 99. You develop an ASP.NET web application. The application uses a Microsoft SQL Server 2008 Express Edition database. The initial database size is 20 MB. To minimize the web application download time, you create a script that generates the database. You want to run the script after installing the web application. Which steps should you take to correctly configure the web application? (Each correct answer presents part of the solution. Choose four.) 100. Which statements are true about applications that are deployed by using the Copy Web tool? (Each correct answer presents a complete solution. Choose two.)
Chapter 4
Edit the custom action properties. Set the CustomActionData property to /UserName=[EDITA1] /Password=[EDITA2]. Chapter 8
Add the script to the setup project as a resource Add a web setup project to the solution Configure a dependency for SQL Server 2008 Express Add a custom action to the web setup project to run the database creation script
Chapter 8
-You can transfer the application by using shared folders, FTP, or HTTP. - After deploying the application, you can update files by editing them directly on the web server. Chapter 8
101. Your team is developing an ASP.NET web application. Each team member maintains a local copy of the web application so that he or she can work offline. You modify several webpages while working offline. Another developer modifies other webpages in her local copy of the application, and then synchronizes the changes with the shared website. You need to synchronize your changes with the shared website. Which of the following will occur when you attempt to synchronize your changes? 102. You create a web form that includes three buttons. You configure the Click event for each button to invoke the following event handler. private void Button_Click(object sender, System.EventArgs e) { } You need to add code to the event handler to set the text of a label named Label1 to the identifier of the clicked button. Which code segment should you add? 103. You are developing a web application that uses cookies to track user preferences. The web browser is not correctly submitting cookies to the web server. You need to troubleshoot the problem. Which solution allows you to most thoroughly verify the cookies the browser submits to the web server? 104. You develop a web application. Users periodically report that the web application is slow to respond or does not respond. You want to configure the web application to display tracing information for the 100 most recent page requests in the Trace.axd file. Which Web.config configuration element should you use?
The Copy Web Site tool will overwrite the outdated versions of the files you modified with your updated webpages. The other developer's files will not be affected. Chapter 8