0

I have created one custom route

routes.MapRoute("Exams",
        "Exams/{id}/{name}",
        new { controller = "Exam", action = "SingleExam", id = "", name = (string) null },
        new[] { "MockTests.FrontEnd.Controllers" } 
    );

For this I am creating link as

http://localhost:61575/Exams/12/maharashtra+mba+common+entrance+test

But his gives error as

The resource cannot be found

SingleExam code

public ActionResult SingleExam(int id,string name)
        {
            return View();
        }

Other Routes

routes.MapRoute(
            "Default",
            "{controller}/{action}/{id}",
            new { controller = "User", action = "Register", id = UrlParameter.Optional },
            new[] { "MockTests.FrontEnd.Controllers" }
        );

What wrong I am doing ?

vaibhav shah
  • 4,939
  • 19
  • 58
  • 96

0 Answers0