public ActionResult Insert(Models.Comments objComment) { try { clsDataBaseMethodsComments objDB = new clsDataBaseMethodsComments(); objDB.Insert(objComment); TempData["Success"] = "¡Comment Created!"; return(RedirectToAction("Index", "Comments", new { id = objComment.intPostId })); } catch (Exception ex) { ViewBag.Error = ex.Message; } return(View(objComment)); }
public JsonResult LoadGrid(string id) { try { clsDataBaseMethodsComments objDB = new clsDataBaseMethodsComments(); if (id == null || id == "") { id = "0"; } int intValorId = Convert.ToInt32(id); return(Json(objDB.ListComments(intValorId))); } catch (Exception) { return(null); } }