forum

home / developersection / forums / returning partial view from controller

Returning partial view from controller

Sunil Singh 1716 16-Sep-2017

 I want to return studentlist as a partial view. Here is my index method code 

  public ActionResult Index(Student Model)
        {
            using (var ctx = new School_Context())
            {
                ctx.Students.Add(Model);
                ViewBag.msg = "Record Saved!!";
                ctx.SaveChanges();
                return PartialView("StudentList");
            }
        }

But I don’t know where the problem is? When I run this code it shows error that view is not found.


Updated on 16-Sep-2017
Can you answer this question?

Answer

1 Answers

Liked By