Professional Documents
Culture Documents
70 564
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: 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
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: 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: 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: 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: 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.
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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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.
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
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
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: 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: 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: 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: 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.
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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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.
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: 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