using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using TestProjectMvc.Models; using PagedList; using PagedList.Mvc; namespace TestProjectMvc.Controllers { public class HomeController : Controller {
public ActionResult Index() { UserViewModel obj = new UserViewModel(); UserBAL user = new UserBAL(); obj.UserList = user.GetListRecord(user).ToPagedList(1, 2); return View(obj); }
public ActionResult Add() { return PartialView("_AddUser"); }
[HttpPost] public ActionResult Add(UserViewModel data) { UserViewModel obj = new UserViewModel(); UserBAL user = new UserBAL(); if (ModelState.IsValid) { user.InsertUpdateRecord(data.User); } return new EmptyResult(); }
} }
Liked By
Write Answer
How to add new record in mvc Using ajax
Join MindStick Community
You have need login or register for voting of answers or question.
Anonymous User
19-Nov-2015