Which code segment should you use?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses LINQ to SQL.
The application contains the following model.
Each region contains a single vendor. Customers order parts from the vendor that is located in their region.
You need to ensure that each row in the Customer table references the appropriate row from the Vendor table.
Which code segment should you use?
Which event handler should you add?
You are implementing an ASP.NET page in an e-commerce application.
Code in a btnAddToCart_Click event handler adds a product to the shopping cart.
The page should check the status of the shopping cart and always show a cart icon when one or more items are in the shopping cart.
The page should hide the icon when the shopping cart has no items.
You need to add an event handler to implement this requirement.
Which event handler should you add?
Which two approaches should you recommend?
You are designing an ASP.NET Web application.
You have the following requirements:
Users must be allowed to save their work in progress on one computer and to continue the work on another computer.
Data that is submitted for processing must be valid, and invalid data must be rejected.
Primary key constraints within the database must be enabled at all times.
The application must store only data that is entered by the user.
You need to design data validation to support the requirements.
Which two approaches should you recommend? (Each correct answer presents part of the solution. Choose two.)
Which control should you use?
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application that displays an image. You need to ensure that users can stretch and scale the image. Which control should you use?
Which line of code should you use?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application.
You use the ADO.NET Entity Framework Designer to model entities. You retrieve an entity from an object context.
A different application updates the database. You need to update the entity instance to reflect updated values in the database.
Which line of code should you use?
Which control markup should you use?
You are implementing an ASP.NET Web site that will be accessed by an international audience.
The site contains global and local resources for display elements that must be translated into the language that is selected by the user.
You need to ensure that the Label control named lblCompany displays text in the user’s selected language from the global resource file.
Which control markup should you use?
Which approach should you recommend?
You need to design a solution for programmatically adding reusable user-interface code to views and allowing the user-interface code to be rendered from the server side.
Which approach should you recommend
What should you do?
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server 2008 database. The database includes a table that contains information about all the employees. The database table has a field named EmployeeType that identifies whether an employee is a Contractor or a Permanent employee. You declare the Employee entity base type. You create a new Association entity named Contractor that inherits the Employee base type. You need to ensure that all Contractors are bound to the Contractor class. What should you do?
What should you do?
You use Microsoft .NET Framework 4.0 to develop an application that uses LINQ to SQL. The LINQ to SQL model contains the Product entity.
A stored procedure named GetActiveProducts performs a query that returns the set of active products from the database.
You need to invoke the stored procedure to return the active products, and you must ensure that the LINQ to SQL context can track changes to these entities. What should you do?
which attribute should you set to true?
You are testing an existing ASP.NET page.
The page includes a text box.
You are able to execute malicious JavaScript code by typing it in the text box and submitting.
You need to configure the page to prevent JavaScript code from being submitted by the text box.
In the @ Page directive, which attribute should you set to true?