Guest User

Guest User

  • Tech Writer
  • 2.1k
  • 472.9k

How to route to your actioname without Error/Application?

Aug 17 2020 9:42 AM
Hi Team
 
I am struggling to route to my page, what could i be missing below? I keep on getting this Error/Application.
  1.  // Route to Courses.  
  2.   
  3.             routes.MapRoute(  
  4.                 name:"Courses",  
  5.                 url:"courses-registration/",  
  6.                 defaults: new {controller="Home", action="CoursesRegistration", url=UrlParameter.Optional}  
  7.   
  8.             );  
  9.   
  10.  //GET/Courses-List  
  11.         public ActionResult CoursesRegistration()  
  12.         {  
  13.             return View();  
  14.         }  
  15.   
  16. <div class="modal-footer">  
  17.                         <button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>  
  18.                         <a class="btn btn-large btn-success" id="fire" href="@Url.Action("Courses-Registration","Home")">Create Courses</a>  
  19.                         <script type="text/javascript">      
  20.                             $('#fire').on('click', function (e) {  
  21.   
  22.   
  23.   
  24.                             });  
  25.                             </script>  
  26. </div>  
 

Answers (5)