News:

SQL Table To C# Entity Model ConverterEntity Model (Class Properties) to SQL Table ConverterIf you encounter any trouble visiting our site, please contact us.

Advertisement

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;
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?

  1. Replace line 05 with the following code segment

    routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Home", action = "DetailsByUsername", id = "" });
    
  2. Replace line 05 with the following code segment.

    routes.MapRoute( "Default", "{controller}/{action}/{username}", new { controller = "Home", action = "DetailsByUsername", username = "" }, new { username = @"\w{3,20}" });
    
  3. At line 04, add the following code segment.

    routes.MapRoute("Details by Username", "{username}", new { controller = "Home", action = "DetailsByUsername" }, new { username = @"\w{3,20}" });
    
  4. At line 04, add the following code segment

    routes.MapRoute("Details by Username","{id}",new { controller = "Home", action = "DetailsByUsername" }, new { id = @"\w{3,20}" });
    
Answer: Answer is c
comments powered by Disqus
Advertisement

BCS Preparation now even more easy. ReadBD is the place where you can find all kind of resources to be successful in BCS,Bank,Islami Bank exam and interview.

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;