Users Pricing

forum

Home Forums Returning partial view from controller – MindStick

Returning partial view from controller

Sunil Singh 2511 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.


1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md