// [ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)] public ActionResult FetchData() { var albums = AlbumRepo.GetAlbums(); return(Json(albums, JsonRequestBehavior.AllowGet)); //return View(albums); }
public ActionResult Index() { var albums = AlbumRepo.GetAlbums(); HttpCookie _userInfoCookies = Request.Cookies["UserInfo"]; if (_userInfoCookies != null) { string UserName = _userInfoCookies["UserName"].ToString(); } return(View(albums)); }
public ActionResult Index(int?albumId, string albumName) { var albums = AlbumRepo.GetAlbums(); if (!string.IsNullOrEmpty(albumName)) { albums = albums.Where(a => a.Title.Contains(albumName)).ToList(); } if (albumId.HasValue) { albums = albums.Where(a => a.AlbumId == albumId).ToList(); } return(PartialView("_grid", albums)); }
public ActionResult Index(int?albumId, string albumName) { var albums = AlbumRepo.GetAlbums(); if (Request.Form["btnSubmit"] != null) { if (!string.IsNullOrEmpty(albumName)) { albums = albums.Where(a => a.Title.Contains(albumName)).ToList(); } if (albumId.HasValue) { albums = albums.Where(a => a.AlbumId == albumId).ToList(); } return(PartialView("_grid", albums)); } else if (Request.Form["btnDelete"] != null) { } return(PartialView("_grid", albums)); }
public ActionResult deleteData(string dataToBeDeleted) { var albums = AlbumRepo.GetAlbums(); //if (Request.Form["btnSubmit"] != null) //{ // if (!string.IsNullOrEmpty(albumName)) // albums = albums.Where(a => a.Title.Contains(albumName)).ToList(); // if (albumId.HasValue) // albums = albums.Where(a => a.AlbumId == albumId).ToList(); // return PartialView("_grid", albums); //} if (Request.Form["data"] != null) { String[] dids = Request.Form["data"].Split(new char[] { ',' }); } if (dataToBeDeleted != null) { String[] dids = dataToBeDeleted.Split(new char[] { ',' }); } return(PartialView("_grid", albums)); }
// // GET: /Home/ public ActionResult Index() { var albums = AlbumRepo.GetAlbums(); return(View(albums)); }