Hi Team
I have a routing problem, i have configured my routing well, but some how i am encountering a problem. This is my logic below;
- // Route to CoursesRegistered
- routes.MapRoute(
- name:"CoursesRegistration",
- url:"courses-enrolled-for/",
- defaults: new {controller="Home", action = "CoursesRegistration", url = UrlParameter.Optional}
- );
- [HttpPost]
- public ActionResult CoursesRegistration( eNtsaRegCourses model)
- {
- if(ModelState.IsValid)
- {
- try
- {
- cb.SaveChanges();
- return Json(new { success = true });
- }catch(Exception ex)
- {
- ModelState.AddModelError("", ex.Message);
- }
- }
- return PartialView("CoursesRegistration", model);
- }
- // saving changes here.
- static void SaveChanges(eNtsaCourses model)
- {
- }
- @using (Html.BeginForm("CreateCoursesRegistration", "Home", FormMethod.Post, new { id = "createCourseForm", @class = "form-horizontal" }))
- {
- class="modal-footer">
- class="btn btn-secondary" data-dismiss="modal">Cancel
- "@Url.Action("CoursesRegistration", "Home")" class="btn btn-large btn-success", onclick="$('#exampleModal').modal('show')">Create Courses
- }
Ashutosh GuptaPosted Aug 21, 2020, 12:08 AM
Guest UserPosted Aug 20, 2020, 7:55 AM
Salman BegPosted Aug 20, 2020, 7:53 AM