Example #1
0
        public ActionResult StudentInformation([ModelBinder(typeof(StudentModelBinder))] StudentViewModel studentViewModel)
        {
            try
            {
                var name = studentViewModel.Name;

                StudentDBEntities s = new StudentDBEntities();
                s.InsertStudentInfo(studentViewModel.StudentId, studentViewModel.Name, studentViewModel.Address,
                                    studentViewModel.City, studentViewModel.State, studentViewModel.Country, studentViewModel.Department, studentViewModel.Marks);

                ViewBag.InsertMessage = "Record Inserted";
            }
            catch (Exception ex)
            {
            }

            return(View("Index"));
        }