Home » Microsoft » 70-486 v.2 » Which code segments should you include in Target1, Target 2 and Target 3 to implement the route handler?
DRAG DROP
You are developing an ASP.NET MVC application that takes customer orders.
Orders are restricted to customers with IP addresses based in the United States.
You need to implement a custom route handler.
You have the following code:
Which code segments should you include in Target1, Target 2 and Target 3 to implement the route handler? To answer, drag the appropriate code segments to the correct targets. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:
Correct Answer:
Explanation/Reference:
Example:
This class implements IRouteHandler and has only one method "GetHttpHandler". The main purpose of this class is to return the instance of CustomHandler class. In the constructor, we are passing the RequestContext to the handler.
{
public class CustomRouteHandler : IRouteHandler
{
public IHttpHandler GetHttpHandler(RequestContext requestContext)
{
return new CustomHandler(requestContext);
}
}
References: http://msdn.microsoft.com/en-us/library/system.web.routing.iroutehandler.gethttphandler.aspx