1. Question: You are developing an ASP.NET Web application. The application includes a Icomparer<string> implementation named CaseInsensitiveComparer that compares strings without case sensitivity You add the following method.(Line numbers are included for reference only.) 01 public IEnumerable<string>SortWords(string[] words) 02 { 03 04 } You need to sort the array by word length and then by alphabetic order, ignoring case. Which code segment should you add at line 03?

    A
    return words.Orderby(a => a, new CaseInsensitiveComparer()).ThenBy(a =>a.Length);

    B
    return words.Orderby(a =>a.Length).Orderby(a => a,new CaseInSensitiveComparer());

    C
    return words.Orderby(a =>a.Length).ThenBy(a=> a, new CaseInSensitiveComparer());

    D
    return words.Orderby(a =>a.Length.toString(), new CaseInSensitiveComparer());

    Note: Not available
    1. Report
  2. Question: You are implementing an ASP.Net web page that includes a Treeview control. You need to ensure that the TreeView control nodes are populated only when they are first expanded. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

    A
    Set the PopulateNodesFromClient property of the TreeView control to true.

    B
    Add an event handler to the TreeNodeDataBound event that includes code to populate the node.

    C
    Set the PopulateOnDemand property of the TreeNode control to true.

    D
    Add an event handler to the TreeNodePopulate event than includes code to populate the node.

    Note: Not available
    1. Report
  3. Question: You are implementing an ASP.NET web application.The application defines the following classes. public class Person { public String Name{get; set;} publicIList<Address> Addresses{get;set;} } public class Address { public String AddressType{get; set;} public string AddressValue{get;set;} } The applicaction must generate XML from personList, wich is a collection of Person instances.The following XML is an example of the schema than the generated XML must use. <Persons> <Person Name="John Doe"> <Address Email="John.Doe@contoso.com"/> <Address AlternativeEmail="John.Doe@contoso.com"/> <Address MSNInstanceMessenger="John.Doe@contoso.com"/> </Person> ..... </Persons> You need to generate the XML. Wich code segment should you use?

    A
    var XML= new XElement("Persons", from person in personList Select (new XElement("Persons", newXElement("Name", person.Name), from addr in person.Addresses select new XElement("Address", newXElement(addr.AddressType, addr.AddressValue)))));

    B
    var XML= new XAttribute("Persons", from person in personList Select (new XElement("Persons", newXAttribute("Name", person.Name), from addr in person.Addresses select new XAttribute("Address", newXAttribute(addr.AddressType, addr.AddressValue)))));

    C
    var XML= new XElement("Persons", from person in personList Select (new XElement("Persons", newXAttribute("Name", person.Name)))

    D
    var XML= new XElement("Persons", from person in personList Select (new XElement("Person", newXAttribute("Name", person.Name), from addr in person.Addresses select new XElement("Address", newXAttribute(addr.AddressType, addr.AddressValue)))));

    Note: Not available
    1. Report
  4. Question: You are developing an ASP.NET web page. The page must display data from XML file named Inventory.xml. Inventory.xml contains data in the following format. <?xml version="1.0" standalone="yes"?> <inventory> <vehicle Make="BMW" Model="M3" Year="2005" Price="30000" instock="Yes"> <Ratings>....</Ratings> </Vechicle> .... </Inventory> You need to display Vehicle elements that have the inStock attribute set to YES. Wich two controls should you add to the page? (Each control presents part of the solution.Choose two.)

    A
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="True" DataSource="inventoryXMLDataSource"> .... </asp:GridView>

    B
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="True" DataSourceID="inventoryXMLDataSource"> .... </asp:GridView>

    C
    <asp:XMLDataSource ID="InventoryXMLDataSource" runat="server" DataFile="Inventory.xml" XPath="/Inventory/Car[@InStock='Yes']"> </asp:XMLDataSource>

    D
    <asp:XMLDataSource ID="InventoryXMLDataSource" runat="server" DataFile="Inventory.xml" XPath="/Inventory/Car/InStock='Yes'"> <Data>Inventory.xml</Data> </asp:XMLDataSource>

    Note: Not available
    1. Report
  5. Question: You are creating an ASP.NET web page that contains several FileUpload controls. The page will be posted to the server after one or more image files are selected for upload. You need to ensure that all uploaded files are saved to the server within one call to a single event handler. What should you do?

    A
    Read the HttpRequest.Files property and call the HttpPostedFile.SaveAs method for each file.

    B
    Read the HttpRequest.inputStream property and call the System.Io.File.WriteLines method or each file.

    C
    Read the HttpRequest.inputStream property and call the HttpResponse.WriteLine method for each file.

    D
    Read the HttpRequest.Files property and call the System.Io.File.WriteLines method for each file.

    Note: Not available
    1. Report
  6. Question: You are developing an ASP.NET web page that includes a textbox control that has ID txtDate. You need to ensure that the user enters a valid date in the text box. Which markup should you use?

    A
    <asp:CompareValidator ID="valDate" runat="server" Type="Date" ControlToCompare="txtDate" Operator="Equal"/>

    B
    <asp:CompareValidator ID="valDate" runat="server" Type="Date" ControlToCompare="txtDate" Operator="DataTypeCheck"/>

    C
    <asp:CompareValidator ID="valDate" runat="server" Type="Date" ControlToValidate="txtDate" Operator="DataTypeCheck"/>

    D
    <asp:CompareValidator ID="valDate" runat="server" Type="Date" ControlToValidate="txtDate" Operator="Equal"/>

    Note: Not available
    1. Report
  7. Question: You are developing an ASP.NET MVC 2 Web Application that displays daily blog posts. Visitors access a blog post page by using a Web address to pass in the year, month, and day -for example, contoso.com/2010/07/20. The application must register the appropriate route to use the Display action of the blog controller. Only page visits with a four digit year, two-digit month and two-digit dat can be passed to the action. You need to ensure that the route is registered correctly, Which code segment should you add?

    A
    routes.MapRoute("DailyBlogPosts", "{year}/{month}/{day}", new { controller="Blog", action="Display", year=@"\d{4}", month=@"\d{2}", day=@"\d{2}" });

    B
    routes.MapRoute("DailyBlogPosts", "{year}/{month}/{day}", new { controller="Blog", action="Display", } new { year=@"\d{4}", month=@"\d{2}", day=@"\d{2}" });

    C
    routes.MapRoute("DailyBlogPosts", "{year}/{month}/{day}", new { controller="Blog", action="Display", } new { year="yyyy", month="mm", day="dd" });

    D
    routes.MapRoute("DailyBlogPosts", "{year}/{month}/{day}", new { controller="Blog", action="Display", year="yyyy", month="mm", day="dd" });

    Note: Not available
    1. Report
  8. Question: You are developing an ASP.NET MVC 2 application. You create a login user control named login.ascx. You need to display Login.ascx in a view. What should you do?

    A
    Use an HTML server-side include.

    B
    Use the HTML.Display method

    C
    Use the HTML.Partial method.

    D
    Use the @Import directive

    Note: Not available
    1. Report
  9. Question: You are developing an ASP.NET web application. The application includes a class library named Contoso.dll that will be used by other ASP.Net applications on the same server. You need to ensure that only one copy of the class library exists on the server. What should you do?

    A
    Add the following code segment to the top of each web page. <%@ Register TagPrefix="cc" NameSpace="contoso" Assembly="contoso" %>

    B
    Install the class library into the Global Assembly Cache on the server.

    C
    Deploy the class library on the App_Code folder

    D
    Add the following assembly attribute to the Contoso class library´s AssemblyInfo.cs file. [assembly: AssemblyConfiguration("Shared")]

    Note: Not available
    1. Report
  10. Question: You are developing an ASP.NET MVC2 application. You add an area named Admin to the application. Admin contains a controller class name to MainController. You create a view named Index outside the Admin area. You need to add a link in the Index view that will call the Default action. Wich markup should you use?

    A
    <%= Html.ActionLink("Admin","Default", "Main", new {area="admin"},null )%>

    B
    <%= Html.RouteLink("Admin","Default", new {area="admin"},"Main" )%>

    C
    <%= Html.RenderAction("Admin","Default", new {area="admin"}); %>

    D
    <%= Html.Action("Admin","Default",new {area="admin"}) %>

    Note: Not available
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd