Web Developer Framework 4.0 Sample Questions – 15

Question: You are implementing an ASP.NET MVC 2 Web application that contains several folders. The Views/Shared/DisplayTemplates folder contains a templated helper named Score.ascx that performs custom formatting of integer values. The Models folder contains a class named Player with the following definition. public class Player { public String Name {… Continue reading

Web Developer Framework 4.0 Sample Questions – 14

Question: You are implementing an ASP.NET MVC 2 Web application. The URL with path /Home/Details/{country} will return a page that provides information about the named country. You need to ensure that requests for this URL that contain an unrecognized country value will not be processed by the Details action of… Continue reading

Web Developer Framework 4.0 Sample Questions – 13

Question: You are implementing an ASP.NET MVC 2 Web application. The URL with path /Home/Details/{country} will return a page that provides information about the named country. You need to ensure that requests for this URL that contain an unrecognized country value will not be processed by the Details action of HomeController…. Continue reading

Web Developer Framework 4.0 Sample Questions – 12

Question: You are implementing a WCF service library. You add a new code file that contains the following code segment. namespace ContosoWCF {[ServiceContract]public interface IRateService{[OperationContract]decimal GetCurrentRate();} public partial class RateService : IRateService{public decimal GetCurrentRate(){decimal currentRate = GetRateFromDatabase();return currentRate;}} } You build the service library and deploy its assembly to an IIS… Continue reading

Web Developer Framework 4.0 Sample Questions – 11

Question: You are implementing an ASP.NET page. You add and configure the following ObjectDataSource. <asp:ObjectDataSource SelectMethod=”GetProductByProductId”ID=”odc” runat=”server” TypeName=”ProductDAL”><SelectParameters><asp:Parameter Name=”productId” Type=”Int32″ /></SelectParameters> </asp:ObjectDataSource> The page will be called with a query string field named pid. You need to configure the ObjectDataSource control to pass the value of the pid field to GetProductsByProductId… Continue reading

Web Developer Framework 4.0 Sample Questions – 10

Question: You are deploying an ASP.NET Web application to a remote server. You need to choose a deployment method that will ensure that all IIS settings, in addition to the Web content, will deploy to the remote server. Which deployment method should you choose? the XCOPY command-line tool the Copy… Continue reading

Web Developer Framework 4.0 Sample Questions – 9

Question: You create a Visual Studio 2010 solution that includes a WCF service project and an ASP.NET project. The service includes a method named GetPeople that takes no arguments and returns an array of Person objects. The ASP.NET application uses a proxy class to access the service. You use the Add… Continue reading

Web Developer Framework 4.0 Sample Questions – 8

Question: You are creating an ASP.NET Web site. The site is configured to use Membership and Role management providers. You need to check whether the currently logged-on user is a member of a role named Administrators. Which code segment should you use? bool isMember = Roles.GetUsersInRole(“Administrators”).Any(); bool isMember = Membership.ValidateUser(User.Identity.Name, “Administrators”);… Continue reading

Web Developer Framework 4.0 Sample Questions – 7

Question: You are implementing an ASP.NET AJAX page that contains two div elements. You need to ensure that the content of each div element can be refreshed individually, without requiring a page refresh. What should you do? Add a form, an update panel, and a script manager to the page. Add… Continue reading

Web Developer Framework 4.0 Sample Questions – 6

Question: A Web page includes the HTML shown in the following code segment. <span id=”ref”><a name=Reference>Check out</a>the FAQ on<a href=”http://www.contoso.com”>Contoso</a>’s web site for more information:<a href=”http://www.contoso.com/faq”> FAQ </a>. </span> <a href=”http://www.contoso.com/ home “> Home </a> You need to write a jQuery statement that will dynamically format in boldface all of the… Continue reading