Microsoft TS: Web Applications Development with Microsoft .NET Framework 4 - 70-515 Exam Practice Test
You are developing an ASP.NET Web page that will display the median value from a sequence of integer
values.
You need to create an extension method to compute the median value.
Which interface should you add the extension method to?
values.
You need to create an extension method to compute the median value.
Which interface should you add the extension method to?
Correct Answer: B
Vote an answer
You are developing an ASP.NET MVC2 view and controller.
The application includes a class names Employee that has a LastName property. The controller requires an
action method that will insert an Employee
instance into a database.
You need to ensure that the data that is submitted is an Employee instance and that a LastName value is
given.
What should you do?
The application includes a class names Employee that has a LastName property. The controller requires an
action method that will insert an Employee
instance into a database.
You need to ensure that the data that is submitted is an Employee instance and that a LastName value is
given.
What should you do?
Correct Answer: D
Vote an answer
You are implementing an ASP.NET Web page
The page includes several controls, but only a GridView requires view state. You set the GridView...
You need to ensure that the page will omit unneeded view state.
Wich @ Page directive should you use?
The page includes several controls, but only a GridView requires view state. You set the GridView...
You need to ensure that the page will omit unneeded view state.
Wich @ Page directive should you use?
Correct Answer: A
Vote an answer
You are developing an ASP.NET MVC 2 application.
A view contains a form that allows users to submit their first name.
You need to display the value that is submitted, and you must ensure that your code avoids cross-site
scripting.
Which code segment should you use?
A view contains a form that allows users to submit their first name.
You need to display the value that is submitted, and you must ensure that your code avoids cross-site
scripting.
Which code segment should you use?
Correct Answer: B
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
You are implementing an ASP.NET page that includes a text box.
You need to validate values that are typed by users to ensure that only numeric values are submitted.
Which control markup should you use?
You need to validate values that are typed by users to ensure that only numeric values are submitted.
Which control markup should you use?
Correct Answer: B
Vote an answer
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.
What should you do?
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.
What should you do?
Correct Answer: B
Vote an answer
You work as an ASP.NET Web Application Developer for SomeCompany.
The company uses Visual Studio .NET 2010 as its application development platform.
You are creating an ASP.NET Web application using .NET Framework 4.0.
The Web application will be accessed by international audience.
The Web application holds global and local resources for display elements that must be translated into the
language that is preferred by the user.
You are required to ensure that a Label control named CompanyLabel displays text in the user's preferred
language from the global resource file.
Which control markup will you use?
The company uses Visual Studio .NET 2010 as its application development platform.
You are creating an ASP.NET Web application using .NET Framework 4.0.
The Web application will be accessed by international audience.
The Web application holds global and local resources for display elements that must be translated into the
language that is preferred by the user.
You are required to ensure that a Label control named CompanyLabel displays text in the user's preferred
language from the global resource file.
Which control markup will you use?
Correct Answer: B
Vote an answer
Explanation: Only visible for Fast2test members. You can sign-up / login (it's free).
You create a Web page that contains the following div.
<div id="target">
</div>
You have a JavaScript array named imageurls that contains a list of image URLs.
You need to write a JavaScript function that will insert images from the URLs into target.
Which code segment should you use?
<div id="target">
</div>
You have a JavaScript array named imageurls that contains a list of image URLs.
You need to write a JavaScript function that will insert images from the URLs into target.
Which code segment should you use?
Correct Answer: A
Vote an answer
You create a new ASP.NET MVC 2 Web application.
The following default routes are created in the Global.asax.cs file. (Line numbers are included for reference
only.)
01 public static void RegisterRoutes(RouteCollection routes)
02 {
03 routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
05 routes.MapRoute("Default", "{controller}/{action}/{id}", new {controller
= "Home", action = "Index", id = ""});
06 }
You implement a controller named HomeController that includes methods with the following signatures.
public ActionResult Index()
public ActionResult Details(int id)
public ActionResult DetailsByUsername(string username)
You need to add a route to meet the following requirements.
The details for a user must to be displayed when a user name is entered as the path by invoking the
DetailsByUsername action.
User names can contain alphanumeric characters and underscores, and can be between 3 and 20 characters long.
What should you do?
The following default routes are created in the Global.asax.cs file. (Line numbers are included for reference
only.)
01 public static void RegisterRoutes(RouteCollection routes)
02 {
03 routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
05 routes.MapRoute("Default", "{controller}/{action}/{id}", new {controller
= "Home", action = "Index", id = ""});
06 }
You implement a controller named HomeController that includes methods with the following signatures.
public ActionResult Index()
public ActionResult Details(int id)
public ActionResult DetailsByUsername(string username)
You need to add a route to meet the following requirements.
The details for a user must to be displayed when a user name is entered as the path by invoking the
DetailsByUsername action.
User names can contain alphanumeric characters and underscores, and can be between 3 and 20 characters long.
What should you do?
Correct Answer: C
Vote an answer
You are developing a Asp.net MVC 2 application
The following Customer class is rendered by the Html.DisplayForModel helper method.
public class Customer
{
public string FirstName { get; set;}
public string LastName { get; set;}
public string EmailAddress { get; set;}
}
You create a partial view named Email.ascx in the Views/Shared/DisplayTemplates folder. Email.ascx
performs custom formatting of e-mail addresses.
You need to ensure that the custom formatting is applied to only the EmailAddress property.
What should you do?
The following Customer class is rendered by the Html.DisplayForModel helper method.
public class Customer
{
public string FirstName { get; set;}
public string LastName { get; set;}
public string EmailAddress { get; set;}
}
You create a partial view named Email.ascx in the Views/Shared/DisplayTemplates folder. Email.ascx
performs custom formatting of e-mail addresses.
You need to ensure that the custom formatting is applied to only the EmailAddress property.
What should you do?
Correct Answer: D
Vote an answer