Hi Team
I have a method, but i want to pass reference byy object, meaning i have declared it as a string, but when i insert raw data it stored to the db, that is not what i want. I want when a user insert any object name it must store it to the record.
- [Route("Home/AllCourses")]
- public ActionResult CoursesRegistration(RegCoursesViewModel eNtsaRegistration)
- {
- string courseName = "TestData"; // This stores to the db.
- string courseName = string.empty; // This is not stored to the record
- eNtsaRegistration.Courses = new eNtsaCourses();
- if (ModelState.IsValid)
- {
- eNtsaRegistration.Courses.Course = courseName;
- eNtsaRegistration.Courses.Id = Guid.NewGuid();
- cb.Courses.Add(eNtsaRegistration.Courses);
- cb.SaveChanges();
- }
- return RedirectToAction("AllCourses");
- }
Vikas JhaPosted Sep 9, 2020, 5:39 AM
Guest UserPosted Sep 9, 2020, 5:34 AM
Vikas JhaPosted Sep 9, 2020, 5:23 AM
https://stackoverflow.com/questions/18873098/asp-net-mvc-get-textbox-input-value
Guest UserPosted Sep 9, 2020, 4:53 AM
Vikas JhaPosted Sep 9, 2020, 4:41 AM
Guest UserPosted Sep 9, 2020, 4:00 AM
Rohit RaoPosted Sep 9, 2020, 3:21 AM