Vous êtes sur la page 1sur 53

Microsoft EXAM 70-564

Pro: Designing and Developing ASP.NET Applications Using the Microsoft .NET Framework 3.5

Total Questions:

55+55= 110

70-564CSHARP Questions:
Question: 1.
You are creating an ASP.NET application by using the .NET Framework 3.5. Users access the application by using different operating systems and different browsers. You plan to incorporate a new control in the application. You need to ensure that the control meets the following business requirements: It can be accessed through the Microsoft Visual Studio .NET 2008 toolbox. It can operate without any other prerequisite controls. Which type of control should you choose? A. A user control B. An ActiveX control C. A Web Parts control D. A custom server control

Answer: D Question: 2.
You are creating an ASP.NET application by using the .NET Framework 3.5. One page contains a DataPager control named DPControl1. Several other pages will display DPControl1. You need to ensure that DPControl1 has properties that are exposed to the WebPartZone controls on all other pages. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. Add a partstyle element to the WebPartZone control on each page. B. Add a zonelement element to the WebPartZone control on each page. C. Copy the DPControl1 control into a new user control. Add a reference to the new user control in each page by using the @Register directive. D. Copy the DPControl1 control into a new web form. Add a reference to the new web form in each page by using the @Register directive.

Answer: BC

Question: 3.
You are creating an ASP.NET application by using the .NET Framework 3.5. You need to create a visual element in the application to meet the following requirements: Custom logic can be implemented. The element can be used in multiple places on each page. The element can be used on multiple pages within the application. The element can be redistributed for use in other applications without sharing source code or layout files. What should you do? A. Create a theme. B. Create a master page. C. Create a user control. D. Create a custom Web control.

Answer: D Question: 4.
You are creating an ASP.NET application by using the .NET Framework 3.5. You create a custom Web server control to implement the shopping cart functionality in the application. You add the following code fragment to the Web.config file of the application. <authentication mode="None" /> < sessionState mode=" SQLServer " /> You need to ensure that when the user re-opens the Web browser, the application retains the state of the shopping cart. Which state management strategy should you use? A. HTTP cookies B. Cache object C. Profile properties D. SessionState object

Answer: A

Question: 5.
You are creating an ASP.NET application by using the .NET Framework 3.5. You create a Web form in your application by using a data-bound Web server control. The Web form displays employee information. You need to ensure that the data-bound Web server control meets the following business requirements: It provides built-in sort capabilities. It displays multiple records by using a default tabular format. Which data-bound Web server control should you use? A. DataList B. ListView C. GridView D. DetailsView

Answer: C Question: 6.
You are creating an ASP.NET application by using the .NET Framework 3.5. You create a Web form in the application that allows users to provide personal information. You add a DropDownList control to the form to capture the residential country of the user. The default item that the DropDownList control displays is the Select Country option. You need to ensure that users select a valid country other than the default option from the DropDownList control. You also need to ensure that the form is created and maintained by using the minimum amount of development effort. Which validation control should you use? A. RangeValidator B. CustomValidator C. RequiredFieldValidator D. RegularExpressionValidator

Answer: C Question: 7.
You are creating an ASP.NET application by using the .NET Framework 3.5. You use the built-in ASP.NET Web server controls in all the Web forms of the application. You access and modify the properties of all Web server controls in the code-behind class of the Web forms. You need to add custom client-side and AJAX behavior to the ASP.NET Web server controls. You also need to ensure minimal effect on the current application code. What should you do?

A. Add an UpdatePanel control in the Web forms for each built-in ASP.NET Web server control. Place the corresponding ASP.NET Web server controls inside the UpdatePanel controls. Create a custom extender control for each built-in ASP.NET Web server control. B. Add the extender controls along with the ASP.NET Web server controls in the Web forms. Create a Web UserControl control for each built-in ASP.NET Web server control. Encapsulate the corresponding ASP.NET Web server control and the client-side and AJAX behavior code in the UserControl control. C. Replace each built-in ASP.NET Web server control with the UserControl control in the Web forms. Create a custom Web server control for each built-in ASP.NET Web server control. Add the corresponding ASP.NET Web server control as a child control, and encapsulate the clientside and AJAX behavior code in the custom Web server control. D. Replace each built-in ASP.NET Web server control with the custom Web server control in the Web forms.

Answer: B Question: 8.
You are creating an ASP.NET application by using the .NET Framework 3.5. You need to ensure that the application meets the following requirements: The layout that must be applied to the pages in the application can be selected by the developers. The layout of the pages can be modified by the developers without the source code modification. A consistent page layout is maintained. What should you do? A. Create multiple themes for the application. Specify a theme for the application in the Web.config file. B. Create multiple master pages for the application. Specify the master page for the application in the Web.config file. C. Create a master page that uses multiple Web Part zones. Disable membership and personalization for the application. D. Ensure that all pages use multiple Web Part zones. Enable membership and personalization for the application.

Answer: B

Question: 9.
You are creating ASP.NET applications by using the .NET Framework 3.5. The applications will be hosted on the same physical Web server. You have the following page layout requirements: A common page layout that applies to all the ASP.NET pages across the Web applications All pages to automatically reflect changes that are made to the common page layout You create a master page that provides the page layout. You need to implement a solution that meets the layout requirements. Which three additional tasks should you perform? (Each correct answer presents part of the solution. Choose three.)

A. Add a @ MasterType directive to each ASP.NET page. B. Add a ContentPlaceholder control to each ASP.NET page. C. Copy the master page into a single folder on the Web server. D. Set the MasterPageFile property on each ASP.NET page to the virtual path of the master page file. E. Configure a virtual directory within the default Web site, and point the virtual directory to the folder that contains the master page. F. Configure a virtual directory within each Web application, and point the virtual directory to the folder that contains the master page.

Answer: CDF Question: 10.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application displays a price list that contains 100 items. The customers use desktop computers, PDAs, mobile phones, or other mobile devices to access the application. The application uses a master page that includes the following layout: A site header at the top of the page. A navigation structure at the side of the page. Content on the remaining space on the page. You need to ensure optimal rendering of the price list for each customer, irrespective of the device category used. What should you do? A. Create a custom master page for mobile-device browsers. Implement a MobilePage class for each device category. B. Create a custom master page for mobile-device browsers. Modify the page that contains the price list to use device filters along with the MasterPageFile attribute of the @ Page directive. C. Add a MultiView control and two View controls to the existing page that contains the price list. Set the ActiveViewIndex value of the MultiView control after you evaluate the Request.Browser.Type property. D. Add a ListView control and a DataPager control to the existing page that contains the price list. Set the PageSize value of the DataPager control after you evaluate the Request.Browser.ScreenPixelsHeight property.

Answer: B

Question: 11.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application will allow end users to select a theme that will be applied to all the pages that the user visits. The preferred theme of the end user will be stored in a profile property. You need to identify the appropriate method to apply the preferred theme to the page. Which method should you choose? A. The page constructor B. The handler for the Page.Load event C. The handler for the Page.PreInit event D. The handler for the Page.Render event

Answer: C Question: 12.


You are creating an ASP.NET application by using the .NET Framework 3.5. You need to ensure that the application meets the following requirements: Each page must have a different layout of page elements. The display properties of the ASP.NET controls must be consistent across pages, regardless of the control style properties set within the individual pages. What should you do? A. Create a master page that references an external cascading style sheet file. B. Define a skin for each type of ASP.NET server control that is used in the application. C. In the Web.config file, specify a value for the masterPageFile attribute of the pages element. D. In the Web.config file, specify a value for the styleSheetTheme attribute of the pages element.

Answer: B Question: 13.


You are creating ASP.NET applications by using the .NET Framework 3.5. You maintain a Web site that contains several nested pages defined in its site map file. You plan to implement a control on each page of the Web site. You need to ensure that the control meets the following requirements: It indicates the current location of the user in the Web site navigation structure. It displays a maximum of three pages. What should you do?

A. Add a TreeView control on each page, and set the MaxDataBindDepth property to 3. B. Add a SiteMapPath control on each page, and set the ParentLevelsDisplayed property to 3. C. Add a SiteMapPath control in the root of the Web site, and set the ParentLevelsDisplayed property to 3. D. Add a TreeView control on each page, and set the StartingNodeOffsetproperty in the XmlSiteMapProvider class to 3.

Answer: B Question: 14.


You are creating ASP.NET applications by using the .NET Framework 3.5. You manage a Web site that currently uses the SiteMapPath control that is connected to a sitemap file. You add a TreeView control to the Web site. You need to configure the TreeView control to display the site navigation from the site map file. What should you do? A. Set the siteMapFile property in the XmlSiteMapProvider control. Set the PopulateNodesFromClient property to true in the TreeView control. B. Set the TransformFile property to connect the XmlDataSource control to the site map file. Configure the TreeView control to use the XmlDataSource control. C. Set the StartingNodeOffset property in the XmlSiteMapProvider control. Set the PopulateNodesFromClient property to true in the TreeView control. D. Configure a SiteMapDataSource control to use the XmlSiteMapProvider control. Configure the TreeView control to use the SiteMapDataSource control.

Answer: D

Question: 15.
You are creating an ASP.NET application by using the .NET Framework 3.5. Airline passengers access the application over the Internet and from airport kiosks around the world. The airport kiosks do not allow users to modify browser settings. You have created language-specific resources for all static text elements in the application. You need to ensure that the content is displayed in the preferred language of the users, regardless of their physical location. What should you do? A. Set the value of the Page.UICulture property to a value stored in a user profile property. B. Set the value of the UICulture attribute to auto within the @ Page directive on each ASP.NET page. C. Set the value of the Thread.CurrentThread.CurrentUICulture property to CultureInfo.InvariantCulture. D. Set the value of the enableClientBasedCulture attribute to true within the globalization element of the Web.config file.

Answer: A

Question: 16.
You are creating an ASP.NET application by using the .NET Framework 3.5. Each page within the application will contain a disclaimer that will use a Label control. The Label control on each page will need to support localization in English and French. You need to implement a resource file strategy that meets the following requirements: A French-region user views the disclaimer in French. All other users view the disclaimer in English. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. Create a resource file for each page for the en-US culture. Place the files in the App_LocalResources directory. B. Create a resource file for each page for the fr culture. Place the files in the App_LocalResources directory. C. Create a resource file for each page for the fr-FR culture. Place the files in the App_GlobalResources directory. D. Create a resource file for each page without any culture specified. Place the files in the App_GlobalResources directory. E. Create a resource file for each page without any culture specified. Place the files in the App_LocalResources directory.

Answer: BE Question: 17.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application will contain a Data Access Layer (DAL) that will support databases from third-party vendors. The application will display data by using a GridView control. You need to ensure that the application meets the following requirements: Allow paging Provide optimistic concurrency Which data access object should you use in the DAL? A. Sql DataReader B. Sql Data Adapter C. OleDb DataReader D. OleDb DataAdapter

Answer: D

Question: 18.
You are creating an ASP.NET application by using the .NET Framework 3.5. The master page contains a Web control that retrieves data from several data sources, including Microsoft SQL Server 2008 and Microsoft Access 2007. You need to ensure that the Web control can provide the retrieved data for use in other controls on the page. What should you do? A. Use a OleDbLiteral object. B. Use a OleDbPermission object. C. Use a OleDbDataTableReader object. D. Use a OleDbDataTableAdapter object.

Answer: D Question: 19.


You are creating ASP.NET applications by using the .NET Framework 3.5. The application has two tables named Products and ProductPrice. The application retrieves and stores data from the Product table into a Dataset object. The application uses the DataSet object to modify and update the data that is retrieved. The update command for the related SqlDataAdapter class is generated automatically by using a SqlCommandBuilder object. You plan to retrieve and modify data from the Product and ProductPrice tables as a unit. You need to ensure that the application can update the data in the tables. What should you do? A. Call the SqlCommandBuilder.RefreshSchema() method before calling the Update() method of the SqlDataAdapter class. B. Call the SqlCommandBuilder.GetUpdateCommand() method before calling the Update() method of the SqlDataAdapter class. C. Set the UpdateCommand property of the SqlDataAdapter class to a SqlCommand object. Use a custom UPDATE statement and call the Update method of the SqlDataAdapter class. D. Set the DataAdapter property of the SqlCommandBuilder class to the SqlDataAdapter object. Use a custom UPDATE statement and call the Update method of the SqlDataAdapter class.

Answer: C

Question: 20.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application stores data in a database that might be implemented in Microsoft SQL Server, Microsoft Access, or a variety of third-party databases. You need to implement a data access strategy that meets the following requirements: The same data access code is used for all database platforms. The application defines the SQL syntax used. The application reduces the vulnerability to SQL injection attacks. What should you do? A. Use the SqlCommandBuilderclass. B. Use parameterized SQL statements. C. Use parameterized stored procedures. D. Use dynamic SQL statements and the StringBuilderclass. E. Use dynamic SQL statements and string concatenation.

Answer: B Question: 21.


You are creating ASP.NET applications by using the .NET Framework 3.5. You plan to display data from a Microsoft SQL Server 2005 database. You write the following stored procedure. (Line numbers are included for reference only.) 01 CREATE PROCEDURE GetEventHistory 02 AS 03 SELECT HistoryID, EventName, EventDescription 04 FROM EVENTHistory FOR XML AUTO You need to ensure that the Web page design meets the following requirements: Each row from the database is displayed on a separate row on the Web page. The result is displayed in a GridView control. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. Use LINQ to XML to retrieve data for the GridView control. B. Use the SqlDataSource control to retrieve data for the GridView control. C. Use the XmlDataSource control to retrieve data for the GridView control. D. Modify line 04 of the stored procedure in the following manner. FROM EVENTHistory E. Modify line 04 of the stored procedure in the following manner. FROM EVENTHistory FOR XML AUTO, ROOT('XML')

Answer: BD

Question: 22.
You are creating an ASP.NET application by using the .NET Framework 3.5. You create a Web form in the application. You add a GridView control to the Web form. You plan to use an existing business object. The business object provides the select, insert, update, and delete methods. You need to implement data binding that will allow the GridView control to take full advantage of the business object. What should you do? A. Set the DataSource property of the GridView control to an instance of the business object. B. Set the DataSourceID property of the GridView control to an instance of the business object. C. Set the DataSourceID property of the GridView control to an ObjectDataSource instance that uses the business object. D. Set the DataSource property of the GridView to the result a LINQ to Objects lambda expression to query the business object.

Answer: C Question: 23.


You are creating an ASP.NET application by using the .NET Framework 3.5. You use LINQ to SQL to query a Microsoft SQL Server 2008 database. You need to create a LINQ query to retrieve information on order and order details. You need to ensure that the LINQ query executes the following SQL statement: SELECT Order.OrderID , Order.Description , OrderDetails.UnitPrice FROM Order JOIN OrderDetails ON Order.OrderID = OrderDetails.OrderID Which LINQ query should you use? A. from order in db.Orders join details in db.OrderDetails on order.OrderID equals details.OrderID select new { order.OrderID, order.Description, details.UnitPrice }; B. from order in db.Order join details in db.OrderDetails on order.OrderID equals details.OrderID into grp from ord in grp.DefaultIfEmpty ()

select n ew { or der.OrderID , order.Description , or d.UnitPrice ) }; C. from order in db.Order join details in db.OrderDetails on order.OrderID equals details.OrderID into grp select n ew { or der.OrderID , order.Description , grp.First (). UnitPrice }; D. from order in db.Orders join details in db.OrderDetails on order.OrderID equals details.OrderID into grp let price = grp.DefaultIfEmpty().First() select new { order.OrderID, order.Description, price.UnitPrice };

Answer: A Question: 24.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application uses LINQ to SQL to retrieve and modify data from a Microsoft SQL Server 2008 database. Queries will be frequently executed in the application. However, concurrency validation is not required on the data. You need to optimize the performance of the application. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. Execute compiled LINQ queries by using the CompiledQuery class. B. Ensure that the AttachAll method is invoked when updating the data. C. Set the ObjectTrackingEnabled property of the DataContext instance to false. D. Set the UpdateCheck property of the Column attributes on each LINQ data class to UpdateCheck.Never.

Answer: AD

Question: 25.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application has the following components: A user interface (UI) Web services A Microsoft SQL Server 2008 database The application communicates with the Web services to access data. The Web services and database are hosted on the same server. The database server is moved to a remote location. The remote location is connected via a highspeed WAN network. A firewall between the database and the ASP.NET application prevents access to all ports except port 80 and port 443. You need to ensure the application maintains as secure a communication possible with the Web services. What should you do? A. Expose the Web services by using the Secure Sockets Layer (SSL) on port 443. B. Expose the Web Services by using HTTP. Disable anonymous access and use Basic authentication. C. Expose the Web Services by using HTTP on port 80. Use IP filtering to restrict calls to the Web service. D. Convert the Web services to WCF services. Expose the WCF services by using the NetNamedPipeBinding class.

Answer: A Question: 26.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application must access a Microsoft SQL Server 2008 database. The database and the ASP.NET application are located on two different servers. The two servers are located on networks separated by a firewall. Only port 80 and port 443 are open through the firewall. You need to ensure that the application can access the database. What should you do? A. Perform all database access by using stored procedures. B. Create a SQL client alias on the Web server. C. Create a Web service and deploy it to the same network as the Web server. D. Create a Web service and deploy it to the same network as the database server.

Answer: D

Question: 27.
You are creating an ASP.NET application by using the .NET Framework 3.5. You plan to develop the application along with a team of developers, graphic designers, and content designers. Some of your team members do not have Microsoft Visual Studio 2008 installed on their computers. You need to ensure that Visual Studio 2008 can automatically recognize new graphics, content, and other media files that are added to the project. What should you do? A. Create a Web site project. Copy the files that are part of the application to the source folder of the application. B. Create a Web site project. Edit the Web.config file of the project to include the files that are part of the application. C. Create a Web application project. Copy the files that are part of the application to the source folder of the application. D. Create a Web application project. Edit the Web.config file of the project to include the files that are part of the application.

Answer: A Question: 28.


You are creating an ASP.NET application by using the .NET Framework 3.5. You plan to deploy the application. You need to ensure that the names of the generated assemblies conform to the rules specified by the deployment environment. What should you do? A. Create the application as a Web application project. Use the Publish option from the Build menu. B. Create the application as a Web site project, and rename the generated assemblies to conform to the rules. C. Create the application as a Web application project, and set the output assembly name to conform to the rules. D. Create the application as a Web site project. Use the aspnet_compiler utility to generate precompiled assemblies by using fixed names that conform to the rules.

Answer: C

Question: 29.
You are creating an ASP.NET application by using the .NET Framework 3.5. Developers update individual pages frequently. You need to ensure that when individual pages are updated, the time required to load the other pages to the Web site remains unaffected. What should you do? Create the application as a Web site project. A. Copy the entire application to the deployment server. Copy only the updated files to the deployment server when a page is updated. Create the application as a Web application project. B. Copy the entire application to the deployment server. Copy only the updated files to the deployment server when a page is updated. Create the application as a Web site project. C. Pre-compile the application by using the updateable option. Copy only the updated files to the deployment server when a page is updated. Create the application as a Web application project. D. Copy only the markup files and compiled assemblies to the deployment server. Copy only the updated files to the deployment server when a page is updated.

Answer: A Question: 30.


You are creating ASP.NET applications by using the .NET Framework 3.5. The application uses the health monitoring events to raise application audit events in the following scenarios: When users log in When users change their passwords When users perform other security-related actions You need to ensure that the application logs all audit events for all applications on the Web server. What should you do? A. Configure the eventMappings node in the Web.config file so that it contains an entry for Success Audits. B. Configure the eventMappings node in the Machine.config file so that it contains an entry for Success Audits. C. Configure the eventMappings node in the Web.config file so that a single entry for auditing events is present for All Audits. D. Configure the eventMappings node in the Machine.config file so that a single entry for auditing events is present for All Audits.

Answer: D

Question: 31.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application has performance problems. You plan to collect sample timing information for each page. You need to ensure that while collecting the information, the following requirements are met: The application remains online. The trace output is not visible to end users. The trace output contains the rendering time for all controls on all the pages. What should you do? A. Set the Trace.IsEnabled property to true in the OnLoad event of each page. B. Set the HttpContext.Current.Trace.IsEnabled property to true in the BeginRequest event handler. C. For the trace element in the Web.config file, set the enabled attribute and the pageOutputattribute to true. D. For the trace element in the Web.config file, set the enabled attribute to true and the pageOutput attribute to false.

Answer: D Question: 32.


You are creating an ASP.NET application by using the .NET Framework 3.5. You deploy the application on multiple servers in the same domain. All servers belong to the same Web farm. You need to ensure that users have to log on only once to gain access to all the servers. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. Configure the session-state section of the Web.config file of each server to use the StateServer option. B. Configure the membership section of the Web.config file of each server to change the password format from hashed to encrypted. C. Configure the machineKey section of the Web.config file of each server to set the validation and decryption keys to be the same for all servers. D. Ensure that the Web.config file of each server includes the same Windows user in the roles attribute of the allow subelement in the authorization element. E. Set the mode attribute to Forms in the authentication element of the Web.config file of each server. Add a forms subelement to the authentication element along with the appropriate configuration.

Answer: AC

Question: 33.
You are creating an ASP.NET application by using the .NET Framework 3.5. The individual pages of the application will be frequently updated. You need to minimize the application startup time after page modifications. What should you do? A. Copy all application code to the Bin folder. B. Copy all application code to the App_Code folder. C. Use the aspnet_compiler utility to precompile the application along with the pages to be updated. D. Use the aspnet_compiler utility to precompile the application along with the fixed assembly names.

Answer: D Question: 34.


You are creating an ASP.NET application by using the .NET Framework 3.5. You are designing the session-state storage management strategy for the application. The application supports a Web farm environment. You need to implement the strategy by setting the storage method for the sessionstate of the application. You also need to ensure optimal performance of the application. What should you do? A. Store the session-state values in SQL Server. B. Store the session-state values in the StateServer state provider. C. Store the session-state values in the memory of the ASP.NET worker process. D. Store the session-state values in an external file that is shared across the Web servers.

Answer: B Question: 35.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application will run on a web farm with no server affinity. Users access the web site daily. You are designing a strategy for persisting user search history. You need to ensure that a user's search history is persisted from one day to the next. What should you do? A. Use Session with SessionStateMode.InProc. B. Use cookies. C. Use Session with SessionStateMode.SQLServer. D. Use ViewState.

Answer: B

Question: 36.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application must dynamically build the user interface. You need to initialize the dynamically added controls so that they are accessible during the lifetime of the page. You also need to ensure that the page code can handle the PostBack events for the controls. What should you do? A. Call the Page.FindControl() method in the Load event of the page. B. Call the Page.ParseControl() method in the Load event of the page. C. Call the Page.FindControl() method in the PreInit event of the page. D. Call the Page.ParseControl() method in the PreInit event of the page.

Answer: D Question: 37.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application uses a control that is bound to a Data Source control. You write code that modifies the parameters for the query used by the Data Source control. Which event should you override? A. PreLoad B. DataBound C. DataBinding D. LoadComplete

Answer: C Question: 38.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application is hosted on Microsoft Windows Server 2008. The server is hosted by an ISP. Only FTP access is available to the server. You plan to improve the search relevancy of the pages in the search engines by responding to URLs that do not have an ASP.NET file extension. You need to ensure that all pages and static content can be requested. What should you do? A. Use an ISAPI filter B. Use an HttpModule object C. Use an HttpHandler object D. Use a Request.PathInfo property

Answer: B

Question: 39.
You create an ASP.NET application by using the .NET Framework 3.5. The application must be deployed by using the http://www.contoso.com/ URL. The application contains several Web forms. You plan to implement Really Simple Syndication (RSS) feeds functionality. The RSS feeds will be consumed by using the http://www.contoso.com/News.rss URL. You need to ensure that the application displays the RSS-formatted information when accessing the specified URL. What should you do? A. Create a Web form named News that releases the RSS feeds. Rename the Web form file by using the .rss extension. B. Create and register a custom HttpHandler class that releases the RSS feeds. Associate the HttpHandler class to the .rss extension. Create and register a custom HttpModule class. C. Create an event handler for the BeginRequest event that releases the RSS feeds. Create an ASMX Web service component named News. D. Create a Web method in the Web service that releases the RSS feeds. Implement the Web service as a REST service. Rename the Web service file by using the .rss extension.

Answer: B Question: 40.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application contains a Web form that sends requests to four Web services during the Page_Load event. You plan to invoke the Web service requests asynchronously. You need to ensure that the Web form can execute the tasks simultaneously. What should you do? A. Invoke the RegisterAsyncTaskmethod. B. Invoke the SetRenderMethodDelegatemethod. C. Invoke the ExecuteRegisteredAsyncTasksmethod. D. Invoke the AddOnPreRenderCompleteAsyncmethod.

Answer: A

Question: 41.
You create an ASP.NET Web application by using the .NET Framework 3.5. The application contains a Web form that invokes a Web service. You need to ensure that the page will render successfully if any of the calls time out. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. Invoke the RegisterAsyncTaskmethod. B. Invoke the AddOnPreRenderCompleteAsyncmethod. C. Set the Page.AsyncTimeoutproperty in the Page.Render method. D. Add the AsyncTimeoutattribute to the Page directive in the Web form.

Answer: AD Question: 42.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application must use an existing Microsoft SQL Server database that stores user names and passwords in the same table. You are not allowed to change the database schema. You need to ensure that the application can use the Login, LoginView, LoginStatus, LoginName, and PasswordRecovery controls to manage user data. What should you do? A. Use the SqlProfileProviderclass. B. Use the SqlMembershipProviderclass. C. Implement a custom profile provider. D. Implement a custom membership provider.

Answer: D

Question: 43.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application will be accessed by users in remote locations over the Internet. You plan to use ASP.NET role management. You need to ensure that any authorization information cached on remote client computers is as secure as possible. What should you do? A. Use the System.Configuration.RsaProtectedConfigurationProvider class. B. Use the System.Configuration.DpapiProtectedConfigurationProvider class. C. Set the cookieProtection attribute to Validation in the roleManager element of the Web.config file. D. Set the cookieProtection attribute to Encryption in the roleManager element of the Web.config file.

Answer: D

Question: 44.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application uses Forms authentication. Your company uses Active Directory. You plan to modify the application to enable users to use their existing Active Directory account to access the application through the Internet. You need to ensure that the application is modified by using the minimum amount of user interface changes, cost, and development effort. What should you do? A. Change the membership provider to ActiveDirectoryMembershipProvider. B. Change the application to use Windows authentication instead of Forms authentication. C. Create a custom membership provider that has access to the corporate Active Directory. D. Remove Forms authentication and install the Active Directory Federation Services 1.1 component.

Answer: A Question: 45.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application will be deployed to an intranet server in your organization. You need to ensure that the application meets the following requirements: Users must be able to log on to the application by using their Active Directory credentials. Each page in the application must display controls for user name and password when accessed by an unauthenticated user. What should you do? A. Use Windows authentication. Enable impersonation. B. Use Windows authentication. Disable impersonation. C. Use Forms authentication. Use the SqlMembershipProviderclass. D. Use Forms authentication. Use the ActiveDirectoryMembershipProviderclass.

Answer: D

Question: 46.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application has several subdirectories under the application root directory. Only the users who belong to an approved role can access the contents of the subdirectory. The user authorizations for the subdirectories must be stored in a single Web.config file in the application root directory. You need to ensure that the node encloses the approved roles and specifies the appropriate subdirectory. Which node should you use? A. <location> B. <clientTarget> C. <authorization> D. <authentication>

Answer: A Question: 47.


You are creating an ASP.NET application by using the .NET Framework 3.5. User accounts in Active Directory are configured to provide access to resources. You need to ensure that users can access the resources through the application. Which XML fragment should you use in the Web.config file? A. <authentication mode="Forms" /> <identity impersonate="false" /> B. <authentication mode="Forms" /> <identity impersonate="true" /> C. <authentication mode="Windows" /> <identity impersonate="false" /> D. <authentication mode="Windows" /> <identity impersonate="true" />

Answer: D

Question: 48.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application will be accessed by Internet users. You plan to enable users to authenticate from the client-side script. You add the following code fragment in the Web.config file of the application. <system.web.extensions> <scripting> <webServices> <authenticationService enabled="true" /> </webServices> </scripting> </system.web.extensions> You need to configure the application to ensure user credentials are validated against Active Directory by using the client-side script. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. Configure the application to use the ActiveDirectoryMembershipProvider class. Configure the application to use the ClientWindowsAuthenticationMembershipProvider class. B. Add the following code fragment to the Web.config file of the application. <authentication mode="None" /> C. Add the following code fragment to the Web.config file of the application. <authentication mode="Forms" /> D. Add the following code fragment to the Web.config file of the application. <authentication mode="Windows" />

Answer: AD Question: 49.


You are creating an ASP.NET application by using the .NET Framework 3.5. Users are authenticated against the Web server by using a custom Single Sign-On (SSO) provider. You need to select an authentication mode in the Web.config file. Which authentication mode should you select? A. None B. Forms C. Passport D. Windows

Answer: B

Question: 50.
You are creating an ASP.NET application by using the .NET Framework 3.5. You deploy the application to a remote server. The application contains form submissions, QueryString parameters, cookies, and ViewState properties. The application connects to a database. You need to ensure that SQL injection attacks are minimized. Which three actions should you perform? (Each correct answer presents part of the solution. Choose three.) A. Constrain and sanitize user input. B. Use parameterized SQL statements. C. Use a least-privileged database account. D. Display error information so that errors can be resolved. E. Convert all stored procedures to dynamic SQL and use the sp_executesql system stored procedure.

Answer: ABC Question: 51.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application will allow users to enter HTML content into a Web form. The HTML content will be stored in a Microsoft SQL Server database. You need to ensure that the content can be posted to the page. You also need to ensure that potentially harmful script cannot be stored in the database. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. Use the Server.HtmlEncode method when saving the text to the database. B. Use the Server.HtmlDecode method when saving the text to the database. C. Set the ValidateRequest attribute of the @Page directive to true. D. Set the ValidateRequest attribute of the @Page directive to false. E. Set the validateRequestattribute of the pages element to true in the Web.config file.

Answer: AD

Question: 52.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application uses the Forms authentication mode. Each folder in the application contains confidential Microsoft Excel files. You need to ensure that bots are not allowed to access the folders in the application. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. Map the Excel files to the ASP.NET ISAPI filter. B. Add a <deny> element to the <authorization> element in the Web.config file. C. Set the authorization node of the lockElementsattribute value in the Web.config file. D. Implement a Robots.txt file in the root directory of the application. E. Implement a Completely Automated Public Turing Tests to Tell Computers and Humans Apart (CAPTCHA) image control on each page of the application.

Answer: AB Question: 53.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application stores and retrieves sensitive data in a Microsoft SQL Server 2008 database. The database is accessed by multiple applications. You need to ensure that other applications that access the database are unable to view any sensitive data that is stored by the application. What should you do? A. Enable the Transparent Data encryption for the SQL Server database. B. Enable the secure sockets layer encryption for the SQL Server connections. C. Encrypt sensitive data by using the Secure Hash algorithm before storing it in the database. D. Encrypt sensitive data by using the Advanced Encryption Standard algorithm before storing it in the database.

Answer: D Question: 54.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application is configured to run by using a specific set of user credentials. Other applications are not allowed to use these user credentials. The application uses asymmetric encryption to encrypt and decrypt messages to other servers. You need to protect the private key used to encrypt and decrypt messages from being accessed by other users or applications on the same server. What should you do?

A. Store the private key in the App_Data directory. B. Use the System.Security.SecureString class. C. Use the System.Security.ProtectedData class. D. Use the Triple Data Encryption Standard algorithm to encrypt the private key before storing it in a file.

Answer: C Question: 55.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application will use ASP.NET Forms authentication. Authentication information will be stored in a Microsoft SQL Server 2008 database instance. You need to ensure that passwords are stored by using a non-reversible technique. You also need to ensure that stored passwords are as secure as possible. What should you do? A. Encrypt the password by using the RC2 algorithm. Store password in the database. B. Encrypt the password by using the 3DES algorithm. Store password in the database. C. Generate a random Salt value. Hash the password by using the SHA1 algorithm. Store the password in the database. D. Generate a Salt value by using a known value. Hash the password by using the SHA256 algorithm. Store password in the database.

Answer: C

70-564VB Questions:
Question: 1.
You are creating an ASP.NET application by using the .NET Framework 3.5. Users access the application by using different operating systems and different browsers. You plan to incorporate a new control in the application. You need to ensure that the control meets the following business requirements: It can be accessed through the Microsoft Visual Studio .NET 2008 toolbox. It can operate without any other prerequisite controls. Which type of control should you choose? A. A user control B. An ActiveX control C. A Web Parts control D. A custom server control

Answer: D Question: 2.
You are creating an ASP.NET application by using the .NET Framework 3.5. One page contains a DataPager control named DPControl1. Several other pages will display DPControl1. You need to ensure that DPControl1 has properties that are exposed to the WebPartZone controls on all other pages. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. Add a partstyle element to the WebPartZone control on each page. B. Add a zonelement element to the WebPartZone control on each page. C. Copy the DPControl1 control into a new user control. Add a reference to the new user control in each page by using the @Register directive. D. Copy the DPControl1 control into a new web form. Add a reference to the new web form in each page by using the @Register directive.

Answer: BC

Question: 3.
You are creating an ASP.NET application by using the .NET Framework 3.5. You need to create a visual element in the application to meet the following requirements: Custom logic can be implemented. The element can be used in multiple places on each page. The element can be used on multiple pages within the application. The element can be redistributed for use in other applications without sharing source code or layout files. What should you do? A. Create a theme. B. Create a master page. C. Create a user control. D. Create a custom Web control.

Answer: D Question: 4.
You are creating an ASP.NET application by using the .NET Framework 3.5. You create a custom Web server control to implement the shopping cart functionality in the application. You add the following code fragment to the Web.config file of the application. <authentication mode="None" /> <sessionState mode="SQLServer" /> You need to ensure that when the user re-opens the Web browser, the application retains the state of the shopping cart. Which state management strategy should you use? A. HTTP cookies B. Cache object C. Profile properties D. SessionState object

Answer: A

Question: 5.
You are creating an ASP.NET application by using the .NET Framework 3.5. You create a Web form in your application by using a data-bound Web server control. The Web form displays employee information. You need to ensure that the data-bound Web server control meets the following business requirements: It provides built-in sort capabilities. It displays multiple records by using a default tabular format. Which data-bound Web server control should you use? A. DataList B. ListView C. GridView D. DetailsView

Answer: C Question: 6.
You are creating an ASP.NET application by using the .NET Framework 3.5. You create a Web form in the application that allows users to provide personal information. You add a DropDownList control to the form to capture the residential country of the user. The default item that the DropDownList control displays is the Select Country option. You need to ensure that users select a valid country other than the default option from the DropDownList control. You also need to ensure that the form is created and maintained by using the minimum amount of development effort. Which validation control should you use? A. RangeValidator B. CustomValidator C. RequiredFieldValidator D. RegularExpressionValidator

Answer: C Question: 7.
You are creating an ASP.NET application by using the .NET Framework 3.5. You use the built-in ASP.NET Web server controls in all the Web forms of the application. You access and modify the properties of all Web server controls in the code-behind class of the Web forms. You need to add custom client-side and AJAX behavior to the ASP.NET Web server controls. You also need to ensure minimal effect on the current application code. What should you do?

A. Add an UpdatePanel control in the Web forms for each built-in ASP.NET Web server control. Place the corresponding ASP.NET Web server controls inside the UpdatePanel controls. B. Create a custom extender control for each built-in ASP.NET Web server control. Add the extender controls along with the ASP.NET Web server controls in the Web forms. C. Create a Web UserControl control for each built-in ASP.NET Web server control. Encapsulate the corresponding ASP.NET Web server control and the client-side and AJAX behavior code in the UserControl control. D. Replace each built-in ASP.NET Web server control with the UserControl control in the Web forms. Create a custom Web server control for each built-in ASP.NET Web server control. E. Add the corresponding ASP.NET Web server control as a child control, and encapsulate the clientside and AJAX behavior code in the custom Web server control. Replace each built-in ASP.NET Web server control with the custom Web server control in the Web forms.

Answer: B Question: 8.
You are creating an ASP.NET application by using the .NET Framework 3.5. You need to ensure that the application meets the following requirements: The layout that must be applied to the pages in the application can be selected by the developers. The layout of the pages can be modified by the developers without the source code modification. A consistent page layout is maintained. What should you do? A. Create multiple themes for the application. Specify a theme for the application in the Web.config file. B. Create multiple master pages for the application. Specify the master page for the application in the Web.config file. C. Create a master page that uses multiple Web Part zones. Disable membership and personalization for the application. D. Ensure that all pages use multiple Web Part zones. Enable membership and personalization for the application.

Answer: B

Question: 9.
You are creating ASP.NET applications by using the .NET Framework 3.5. The applications will be hosted on the same physical Web server. You have the following page layout requirements: A common page layout that applies to all the ASP.NET pages across the Web applications All pages to automatically reflect changes that are made to the common page layout You create a master page that provides the page layout. You need to implement a solution that meets the layout requirements. Which three additional tasks should you perform? (Each correct answer presents part of the solution. Choose three.) A. Add a @ MasterType directive to each ASP.NET page. B. Add a ContentPlaceholder control to each ASP.NET page. C. Copy the master page into a single folder on the Web server. D. Set the MasterPageFile property on each ASP.NET page to the virtual path of the master page file. E. Configure a virtual directory within the default Web site, and point the virtual directory to the folder that contains the master page. F. Configure a virtual directory within each Web application, and point the virtual directory to the folder that contains the master page.

Answer: CDF

Question: 10.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application displays a price list that contains 100 items. The customers use desktop computers, PDAs, mobile phones, or other mobile devices to access the application. The application uses a master page that includes the following layout: A site header at the top of the page. A navigation structure at the side of the page. Content on the remaining space on the page. You need to ensure optimal rendering of the price list for each customer, irrespective of the device category used. What should you do? A. Create a custom master page for mobile-device browsers. Implement a MobilePage class for each device category. B. Create a custom master page for mobile-device browsers. C. Modify the page that contains the price list to use device filters along with the MasterPageFile attribute of the @ Page directive. D. Add a MultiView control and two View controls to the existing page that contains the price list. Set the ActiveViewIndex value of the MultiView control after you evaluate the Request.Browser.Type property. E. Add a ListView control and a DataPager control to the existing page that contains the price list. Set the PageSize value of the DataPager control after you evaluate the Request.Browser.ScreenPixelsHeight property.

Answer: B

Question: 11.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application will allow end users to select a theme that will be applied to all the pages that the user visits. The preferred theme of the end user will be stored in a profile property. You need to identify the appropriate method to apply the preferred theme to the page. Which method should you choose? A. The page constructor B. The handler for the Page.Load event C. The handler for the Page.PreInit event D. The handler for the Page.Render event

Answer: C Question: 12.


You are creating an ASP.NET application by using the .NET Framework 3.5. You need to ensure that the application meets the following requirements: Each page must have a different layout of page elements. The display properties of the ASP.NET controls must be consistent across pages, regardless of the control style properties set within the individual pages. What should you do? A. Create a master page that references an external cascading style sheet file. B. Define a skin for each type of ASP.NET server control that is used in the application. C. In the Web.config file, specify a value for the masterPageFile attribute of the pages element. D. In the Web.config file, specify a value for the styleSheetTheme attribute of the pages element.

Answer: B Question: 13.


You are creating ASP.NET applications by using the .NET Framework 3.5. You maintain a Web site that contains several nested pages defined in its site map file. You plan to implement a control on each page of the Web site. You need to ensure that the control meets the following requirements: It indicates the current location of the user in the Web site navigation structure. It displays a maximum of three pages. What should you do?

A. Add a TreeView control on each page, and set the MaxDataBindDepth property to 3. B. Add a SiteMapPath control on each page, and set the ParentLevelsDisplayed property to 3. C. Add a SiteMapPath control in the root of the Web site, and set the ParentLevelsDisplayed property to 3. D. Add a TreeView control on each page, and set the StartingNodeOffsetproperty in the XmlSiteMapProvider class to 3.

Answer: B Question: 14.


You are creating ASP.NET applications by using the .NET Framework 3.5. You manage a Web site that currently uses the SiteMapPath control that is connected to a sitemap file. You add a TreeView control to the Web site. You need to configure the TreeView control to display the site navigation from the site map file. What should you do? A. Set the siteMapFile property in the XmlSiteMapProvider control. Set the PopulateNodesFromClient property to True in the TreeView control. B. Set the TransformFile property to connect the XmlDataSource control to the site map file. Configure the TreeView control to use the XmlDataSource control. C. Set the StartingNodeOffset property in the XmlSiteMapProvider control. Set the PopulateNodesFromClient property to True in the TreeView control. D. Configure a SiteMapDataSource control to use the XmlSiteMapProvider control. Configure the TreeView control to use the SiteMapDataSource control.

Answer: D Question: 15.


You are creating an ASP.NET application by using the .NET Framework 3.5. Airline passengers access the application over the Internet and from airport kiosks around the world. The airport kiosks do not allow users to modify browser settings. You have created language-specific resources for all static text elements in the application. You need to ensure that the content is displayed in the preferred language of the users, regardless of their physical location. What should you do? A. Set the value of the Page.UICulture property to a value stored in a user profile property. B. Set the value of the UICulture attribute to auto within the @ Page directive on each ASP.NET page. C. Set the value of the Thread.CurrentThread.CurrentUICulture property to CultureInfo.InvariantCulture. D. Set the value of the enableClientBasedCulture attribute to True within the globalization element of the Web.config file.

Answer: A

Question: 16.
You are creating an ASP.NET application by using the .NET Framework 3.5. Each page within the application will contain a disclaimer that will use a Label control. The Label control on each page will need to support localization in English and French. You need to implement a resource file strategy that meets the following requirements: A French-region user views the disclaimer in French. All other users view the disclaimer in English. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. Create a resource file for each page for the en-US culture. Place the files in the App_LocalResources directory. B. Create a resource file for each page for the fr culture. Place the files in the App_LocalResources directory. C. Create a resource file for each page for the fr-FR culture. Place the files in the App_GlobalResources directory. D. Create a resource file for each page without any culture specified. Place the files in the App_GlobalResources directory. E. Create a resource file for each page without any culture specified. Place the files in the App_LocalResources directory.

Answer: BE Question: 17.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application will contain a Data Access Layer (DAL) that will support databases from third-party vendors. The application will display data by using a GridView control. You need to ensure that the application meets the following requirements: Allow paging Provide optimistic concurrency Which data access object should you use in the DAL? A. Sql DataReader B. Sql Data Adapter C. OleDb DataReader D. OleDb DataAdapter

Answer: D

Question: 18.
You are creating an ASP.NET application by using the .NET Framework 3.5. The master page contains a Web control that retrieves data from several data sources, including Microsoft SQL Server 2008 and Microsoft Access 2007. You need to ensure that the Web control can provide the retrieved data for use in other controls on the page. What should you do? A. Use a OleDbLiteral object. B. Use a OleDbPermission object. C. Use a OleDbDataTableReader object. D. Use a OleDbDataTableAdapter object.

Answer: D Question: 19.


You are creating ASP.NET applications by using the .NET Framework 3.5. The application has two tables named Products and ProductPrice. The application retrieves and stores data from the Product table into a Dataset object. The application uses the DataSet object to modify and update the data that is retrieved. The update command for the related SqlDataAdapter class is generated automatically by using a SqlCommandBuilder object. You plan to retrieve and modify data from the Product and ProductPrice tables as a unit. You need to ensure that the application can update the data in the tables. What should you do? A. Call the SqlCommandBuilder.RefreshSchema() method before calling the Update() method of the SqlDataAdapter class. B. Call the SqlCommandBuilder.GetUpdateCommand() method before calling the Update() method of the SqlDataAdapter class. C. Set the UpdateCommand property of the SqlDataAdapter class to a SqlCommand object. Use a custom UPDATE statement and call the Update method of the SqlDataAdapter class. D. Set the DataAdapter property of the SqlCommandBuilder class to the SqlDataAdapter object. Use a custom UPDATE statement and call the Update method of the SqlDataAdapter class.

Answer: C

Question: 20.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application stores data in a database that might be implemented in Microsoft SQL Server, Microsoft Access, or a variety of third-party databases. You need to implement a data access strategy that meets the following requirements: The same data access code is used for all database platforms. The application defines the SQL syntax used. The application reduces the vulnerability to SQL injection attacks. What should you do? A. Use the SqlCommandBuilderclass. B. Use parameterized SQL statements. C. Use parameterized stored procedures. D. Use dynamic SQL statements and the StringBuilderclass. E. Use dynamic SQL statements and string concatenation.

Answer: B Question: 21.


You are creating ASP.NET applications by using the .NET Framework 3.5. You plan to display data from a Microsoft SQL Server 2005 database. You write the following stored procedure. (Line numbers are included for reference only.) 01 CREATE PROCEDURE GetEventHistory 02 AS 03 SELECT HistoryID, EventName, EventDescription 04 FROM EVENTHistory FOR XML AUTO You need to ensure that the Web page design meets the following requirements: Each row from the database is displayed on a separate row on the Web page. The result is displayed in a GridView control. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. Use LINQ to XML to retrieve data for the GridView control. B. Use the SqlDataSource control to retrieve data for the GridView control. C. Use the XmlDataSource control to retrieve data for the GridView control. D. Modify line 04 of the stored procedure in the following manner. FROM EVENTHistory E. Modify line 04 of the stored procedure in the following manner. FROM EVENTHistory FOR XML AUTO, ROOT('XML')

Answer: BD

Question: 22.
You are creating an ASP.NET application by using the .NET Framework 3.5. You create a Web form in the application. You add a GridView control to the Web form. You plan to use an existing business object. The business object provides the select, insert, update, and delete methods. You need to implement data binding that will allow the GridView control to take full advantage of the business object. What should you do? A. Set the DataSource property of the GridView control to an instance of the business object. B. Set the DataSourceID property of the GridView control to an instance of the business object. C. Set the DataSourceID property of the GridView control to an ObjectDataSource instance that uses the business object. D. Set the DataSource property of the GridView to the result a LINQ to Objects lambda expression to query the business object.

Answer: C Question: 23.


You are creating an ASP.NET application by using the .NET Framework 3.5. You use LINQ to SQL to query a SQL Server database. You need to create a LINQ query to retrieve information on order and order details. You need to ensure that the LINQ query executes the following SQL statement: SELECT Order.OrderID , Order.Description , OrderDetails.UnitPrice FROM Order JOIN OrderDetails ON Order.OrderID = OrderDetails.OrderID Which LINQ query should you use? A. From order In db.Orders _ Join details In db.OrderDetails On _ order.OrderID Equals details.OrderID _ Select _ order.OrderID, _ order.Description, _ details.UnitPrice B. From order In db.Orders _ Group Join details In db.OrderDetails On _ order.OrderID Equals details.OrderID Into grp = Group _ From ord In grp.DefaultIfEmpty() _ Select _ order.OrderID, _

order.Description, _ ord.UnitPrice C. From order In db.Orders _ Group Join details In db.OrderDetails On _ order.OrderID Equals details.OrderID Into grp = Group _ Select _ order.OrderID, _ order.Description, _ grp.First().UnitPrice D. From order In db.Orders _ Group Join details In db.OrderDetails On _ order.OrderID Equals details.OrderID Into grp = Group _ Let price = grp.DefaultIfEmpty().First() _ Select _ order.OrderID, _ order.Description, _ price.UnitPrice

Answer: A Question: 24.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application uses LINQ to SQL to retrieve and modify data from a Microsoft SQL Server 2008 database. Queries will be frequently executed in the application. However, concurrency validation is not required on the data. You need to optimize the performance of the application. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. Execute compiled LINQ queries by using the CompiledQuery class. B. Ensure that the AttachAll method is invoked when updating the data. C. Set the ObjectTrackingEnabled property of the DataContext instance to False. D. Set the UpdateCheck property of the Column attributes on each LINQ data class to UpdateCheck.Never.

Answer: AD

Question: 25.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application has the following components: A user interface (UI) Web services A Microsoft SQL Server 2008 database The application communicates with the Web services to access data. The Web services and database are hosted on the same server. The database server is moved to a remote location. The remote location is connected via a highspeed WAN network. A firewall between the database and the ASP.NET application prevents access to all ports except port 80 and port 443. You need to ensure the application maintains as secure a communication possible with the Web services. What should you do? A. Expose the Web services by using the Secure Sockets Layer (SSL) on port 443. B. Expose the Web Services by using HTTP. Disable anonymous access and use Basic authentication. C. Expose the Web Services by using HTTP on port 80. Use IP filtering to restrict calls to the Web service. D. Convert the Web services to WCF services. Expose the WCF services by using the NetNamedPipeBinding class.

Answer: A Question: 26.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application must access a Microsoft SQL Server 2008 database. The database and the ASP.NET application are located on two different servers. The two servers are located on networks separated by a firewall. Only port 80 and port 443 are open through the firewall. You need to ensure that the application can access the database. What should you do? A. Perform all database access by using stored procedures. B. Create a SQL client alias on the Web server. C. Create a Web service and deploy it to the same network as the Web server. D. Create a Web service and deploy it to the same network as the database server.

Answer: D

Question: 27.
You are creating an ASP.NET application by using the .NET Framework 3.5. You plan to develop the application along with a team of developers, graphic designers, and content designers. Some of your team members do not have Microsoft Visual Studio 2008 installed on their computers. You need to ensure that Visual Studio 2008 can automatically recognize new graphics, content, and other media files that are added to the project. What should you do? A. Create a Web site project. Copy the files that are part of the application to the source folder of the application. B. Create a Web site project. Edit the Web.config file of the project to include the files that are part of the application. C. Create a Web application project. Copy the files that are part of the application to the source folder of the application. D. Create a Web application project. Edit the Web.config file of the project to include the files that are part of the application.

Answer: A Question: 28.


You are creating an ASP.NET application by using the .NET Framework 3.5. You plan to deploy the application. You need to ensure that the names of the generated assemblies conform to the rules specified by the deployment environment. What should you do? A. Create the application as a Web application project. Use the Publish option from the Build menu. B. Create the application as a Web site project, and rename the generated assemblies to conform to the rules. C. Create the application as a Web application project, and set the output assembly name to conform to the rules. D. Create the application as a Web site project. Use the aspnet_compiler utility to generate precompiled assemblies by using fixed names that conform to the rules.

Answer: C

Question: 29.
You are creating an ASP.NET application by using the .NET Framework 3.5. Developers update individual pages frequently. You need to ensure that when individual pages are updated, the time required to load the other pages to the Web site remains unaffected. What should you do? A. Create the application as a Web site project. Copy the entire application to the deployment server. Copy only the updated files to the deployment server when a page is updated. B. Create the application as a Web application project. Copy the entire application to the deployment server. Copy only the updated files to the deployment server when a page is updated. C. Create the application as a Web site project. Pre-compile the application by using the updateable option. Copy only the updated files to the deployment server when a page is updated. D. Create the application as a Web application project. Copy only the markup files and compiled assemblies to the deployment server. Copy only the updated files to the deployment server when a page is updated.

Answer: A Question: 30.


You are creating ASP.NET applications by using the .NET Framework 3.5. The application uses the health monitoring events to raise application audit events in the following scenarios: When users log in When users change their passwords When users perform other security-related actions You need to ensure that the application logs all audit events for all applications on the Web server. What should you do? A. Configure the eventMappings node in the Web.config file so that it contains an entry for Success Audits. B. Configure the eventMappings node in the Machine.config file so that it contains an entry for Success Audits. C. Configure the eventMappings node in the Web.config file so that a single entry for auditing events is present for All Audits. D. Configure the eventMappings node in the Machine.config file so that a single entry for auditing events is present for All Audits.

Answer: D

Question: 31.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application has performance problems. You plan to collect sample timing information for each page. You need to ensure that while collecting the information, the following requirements are met: The application remains online. The trace output is not visible to end users. The trace output contains the rendering time for all controls on all the pages. What should you do? A. Set the Trace.IsEnabled property to True in the OnLoad event of each page. B. Set the HttpContext.Current.Trace.IsEnabled property to True in the BeginRequest event handler. C. For the trace element in the Web.config file, set the enabled attribute and the pageOutputattribute to True. D. For the trace element in the Web.config file, set the enabled attribute to True and the pageOutput attribute to False.

Answer: D Question: 32.


You are creating an ASP.NET application by using the .NET Framework 3.5. You deploy the application on multiple servers in the same domain. All servers belong to the same Web farm. You need to ensure that users have to log on only once to gain access to all the servers. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. Configure the session-state section of the Web.config file of each server to use the StateServer option. B. Configure the membership section of the Web.config file of each server to change the password format from hashed to encrypted. C. Configure the machineKey section of the Web.config file of each server to set the validation and decryption keys to be the same for all servers. D. Ensure that the Web.config file of each server includes the same Windows user in the roles attribute of the allow subelement in the authorization element. E. Set the mode attribute to Forms in the authentication element of the Web.config file of each server. Add a forms subelement to the authentication element along with the appropriate configuration.

Answer: AC

Question: 33.
You are creating an ASP.NET application by using the .NET Framework 3.5. The individual pages of the application will be frequently updated. You need to minimize the application startup time after page modifications. What should you do? A. Copy all application code to the Bin folder. B. Copy all application code to the App_Code folder. C. Use the aspnet_compiler utility to precompile the application along with the pages to be updated. D. Use the aspnet_compiler utility to precompile the application along with the fixed assembly names.

Answer: D Question: 34.


You are creating an ASP.NET application by using the .NET Framework 3.5. You are designing the session-state storage management strategy for the application. The application supports a Web farm environment. You need to implement the strategy by setting the storage method for the sessionstate of the application. You also need to ensure optimal performance of the application. What should you do? A. Store the session-state values in SQL Server. B. Store the session-state values in the StateServer state provider. C. Store the session-state values in the memory of the ASP.NET worker process. D. Store the session-state values in an external file that is shared across the Web servers.

Answer: B Question: 35.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application will run on a web farm with no server affinity. Users access the web site daily. You are designing a strategy for persisting user search history. You need to ensure that a user's search history is persisted from one day to the next. What should you do? A. Use Session with SessionStateMode.InProc. B. Use cookies. C. Use Session with SessionStateMode.SQLServer. D. Use ViewState.

Answer: B

Question: 36.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application must dynamically build the user interface. You need to initialize the dynamically added controls so that they are accessible during the lifetime of the page. You also need to ensure that the page code can handle the PostBack events for the controls. What should you do? A. Call the Page.FindControl() method in the Load event of the page. B. Call the Page.ParseControl() method in the Load event of the page. C. Call the Page.FindControl() method in the PreInit event of the page. D. Call the Page.ParseControl() method in the PreInit event of the page.

Answer: D Question: 37.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application uses a control that is bound to a Data Source control. You write code that modifies the parameters for the query used by the Data Source control. Which event should you override? A. PreLoad B. DataBound C. DataBinding D. LoadComplete

Answer: C Question: 38.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application is hosted on Microsoft Windows Server 2008. The server is hosted by an ISP. Only FTP access is available to the server. You plan to improve the search relevancy of the pages in the search engines by responding to URLs that do not have an ASP.NET file extension. You need to ensure that all pages and static content can be requested. What should you do? A. Use an ISAPI filter B. Use an HttpModule object C. Use an HttpHandler object D. Use a Request.PathInfo property

Answer: B

Question: 39.
You create an ASP.NET application by using the .NET Framework 3.5. The application must be deployed by using the http://www.contoso.com/ URL. The application contains several Web forms. You plan to implement Really Simple Syndication (RSS) feeds functionality. The RSS feeds will be consumed by using the http://www.contoso.com/News.rss URL. You need to ensure that the application displays the RSS-formatted information when accessing the specified URL. What should you do? A. Create a Web form named News that releases the RSS feeds. Rename the Web form file by using the .rss extension. B. Create and register a custom HttpHandler class that releases the RSS feeds. Associate the HttpHandler class to the .rss extension. Create and register a custom HttpModule class. C. Create an event handler for the BeginRequest event that releases the RSS feeds. Create an ASMX Web service component named News. D. Create a Web method in the Web service that releases the RSS feeds. Implement the Web service as a REST service. Rename the Web service file by using the .rss extension.

Answer: B Question: 40.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application contains a Web form that sends requests to four Web services during the Page_Load event. You plan to invoke the Web service requests asynchronously. You need to ensure that the Web form can execute the tasks simultaneously. What should you do? A. Invoke the RegisterAsyncTaskmethod. B. Invoke the SetRenderMethodDelegatemethod. C. Invoke the ExecuteRegisteredAsyncTasksmethod. D. Invoke the AddOnPreRenderCompleteAsyncmethod.

Answer: A

Question: 41.
You create an ASP.NET Web application by using the .NET Framework 3.5. The application contains a Web form that invokes a Web service. You need to ensure that the page will render successfully if any of the calls time out. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. Invoke the RegisterAsyncTaskmethod. B. Invoke the AddOnPreRenderCompleteAsyncmethod. C. Set the Page.AsyncTimeoutproperty in the Page.Render method. D. Add the AsyncTimeoutattribute to the Page directive in the Web form.

Answer: AD Question: 42.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application must use an existing Microsoft SQL Server database that stores user names and passwords in the same table. You are not allowed to change the database schema. You need to ensure that the application can use the Login, LoginView, LoginStatus, LoginName, and PasswordRecovery controls to manage user data. What should you do? A. Use the SqlProfileProviderclass. B. Use the SqlMembershipProviderclass. C. Implement a custom profile provider. D. Implement a custom membership provider.

Answer: D

Question: 43.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application will be accessed by users in remote locations over the Internet. You plan to use ASP.NET role management. You need to ensure that any authorization information cached on remote client computers is as secure as possible. What should you do? A. Use the System.Configuration.RsaProtectedConfigurationProvider class. B. Use the System.Configuration.DpapiProtectedConfigurationProvider class. C. Set the cookieProtection attribute to Validation in the roleManager element of the Web.config file. D. Set the cookieProtection attribute to Encryption in the roleManager element of the Web.config file.

Answer: D

Question: 44.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application uses Forms authentication. Your company uses Active Directory. You plan to modify the application to enable users to use their existing Active Directory account to access the application through the Internet. You need to ensure that the application is modified by using the minimum amount of user interface changes, cost, and development effort. What should you do? A. Change the membership provider to ActiveDirectoryMembershipProvider. B. Change the application to use Windows authentication instead of Forms authentication. C. Create a custom membership provider that has access to the corporate Active Directory. D. Remove Forms authentication and install the Active Directory Federation Services 1.1 component.

Answer: A Question: 45.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application will be deployed to an intranet server in your organization. You need to ensure that the application meets the following requirements: Users must be able to log on to the application by using their Active Directory credentials. Each page in the application must display controls for user name and password when accessed by an unauthenticated user. What should you do? A. Use Windows authentication. Enable impersonation. B. Use Windows authentication. Disable impersonation. C. Use Forms authentication. Use the SqlMembershipProviderclass. D. Use Forms authentication. Use the ActiveDirectoryMembershipProviderclass.

Answer: D

Question: 46.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application has several subdirectories under the application root directory. Only the users who belong to an approved role can access the contents of the subdirectory. The user authorizations for the subdirectories must be stored in a single Web.config file in the application root directory. You need to ensure that the node encloses the approved roles and specifies the appropriate subdirectory. Which node should you use? A. <location> B. <clientTarget> C. <authorization> D. <authentication>

Answer: A Question: 47.


You are creating an ASP.NET application by using the .NET Framework 3.5. User accounts in Active Directory are configured to provide access to resources. You need to ensure that users can access the resources through the application. Which XML fragment should you use in the Web.config file? A. <authentication mode="Forms" /> <identity impersonate="false" /> B. <authentication mode="Forms" /> <identity impersonate="true" /> C. <authentication mode="Windows" /> <identity impersonate="false" /> D. <authentication mode="Windows" /> <identity impersonate="true" />

Answer: D

Question: 48.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application will be accessed by Internet users. You plan to enable users to authenticate from the client-side script. You add the following code fragment in the Web.config file of the application. < system.web.extensions > < scripting > < webService s > < authenticationService enabled="true" / > < /webServices > < /scripting > < /system.web.extensions > You need to configure the application to ensure user credentials are validated against Active Directory by using the client-side script. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. Configure the application to use the ActiveDirectoryMembershipProvider class. B. Configure the application to use the ClientWindowsAuthenticationMembershipProvider class. C. Add the following code fragment to the Web.config file of the application. < authentication mode="None" / > D. Add the following code fragment to the Web.config file of the application. < authentication mode="Forms" / > E. Add the following code fragment to the Web.config file of the application. < authentication mode="Windows" / >

Answer: AD Question: 49.


You are creating an ASP.NET application by using the .NET Framework 3.5. Users are authenticated against the Web server by using a custom Single Sign-On (SSO) provider. You need to select an authentication mode in the Web.config file. Which authentication mode should you select? A. None B. Forms C. Passport D. Windows

Answer: B

Question: 50.
You are creating an ASP.NET application by using the .NET Framework 3.5. You deploy the application to a remote server. The application contains form submissions, QueryString parameters, cookies, and ViewState properties. The application connects to a database. You need to ensure that SQL injection attacks are minimized. Which three actions should you perform? (Each correct answer presents part of the solution. Choose three.) A. Constrain and sanitize user input. B. Use parameterized SQL statements. C. Use a least-privileged database account. D. Display error information so that errors can be resolved. E. Convert all stored procedures to dynamic SQL and use the sp_executesql system stored procedure.

Answer: ABC Question: 51.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application will allow users to enter HTML content into a Web form. The HTML content will be stored in a Microsoft SQL Server database. You need to ensure that the content can be posted to the page. You also need to ensure that potentially harmful script cannot be stored in the database. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A. Use the Server.HtmlEncode method when saving the text to the database. B. Use the Server.HtmlDecode method when saving the text to the database. C. Set the ValidateRequest attribute of the @Page directive to True. D. Set the ValidateRequest attribute of the @Page directive to False. E. Set the validateRequestattribute of the pages element to True in the Web.config file.

Answer: AD Question: 52.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application uses the Forms authentication mode. Each folder in the application contains confidential Microsoft Excel files. You need to ensure that bots are not allowed to access the folders in the application. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A. Map the Excel files to the ASP.NET ISAPI filter. B. Add a <deny> element to the <authorization> element in the Web.config file. C. Set the authorization node of the lockElementsattribute value in the Web.config file. D. Implement a Robots.txt file in the root directory of the application. E. Implement a Completely Automated Public Turing Tests to Tell Computers and Humans Apart (CAPTCHA) image control on each page of the application.

Answer: AB Question: 53.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application stores and retrieves sensitive data in a Microsoft SQL Server 2008 database. The database is accessed by multiple applications. You need to ensure that other applications that access the database are unable to view any sensitive data that is stored by the application. What should you do? A. Enable the Transparent Data encryption for the SQL Server database. B. Enable the secure sockets layer encryption for the SQL Server connections. C. Encrypt sensitive data by using the Secure Hash algorithm before storing it in the database. D. Encrypt sensitive data by using the Advanced Encryption Standard algorithm before storing it in the database.

Answer: D Question: 54.


You are creating an ASP.NET application by using the .NET Framework 3.5. The application is configured to run by using a specific set of user credentials. Other applications are not allowed to use these user credentials. The application uses asymmetric encryption to encrypt and decrypt messages to other servers. You need to protect the private key used to encrypt and decrypt messages from being accessed by other users or applications on the same server. What should you do? A. Store the private key in the App_Data directory. B. Use the System.Security.SecureString class. C. Use the System.Security.ProtectedData class. D. Use the Triple Data Encryption Standard algorithm to encrypt the private key before storing it in a file.

Answer: C

Question: 55.
You are creating an ASP.NET application by using the .NET Framework 3.5. The application will use ASP.NET Forms authentication. Authentication information will be stored in a Microsoft SQL Server 2008 database instance. You need to ensure that passwords are stored by using a non-reversible technique. You also need to ensure that stored passwords are as secure as possible. What should you do? A. Encrypt the password by using the RC2 algorithm. Store password in the database. B. Encrypt the password by using the 3DES algorithm. Store password in the database. C. Generate a random Salt value. Hash the password by using the SHA1 algorithm. Store the password in the database. D. Generate a Salt value by using a known value. Hash the password by using the SHA256 algorithm. Store password in the database.

Answer: C

Vous aimerez peut-être aussi