public ActionResult DeleteQuery(int id) { int no = -1; var uq = new VAdvantage.Model.MUserQuery(Session["ctx"] as VAdvantage.Utility.Ctx, id, null); if (uq != null) { // get name of the query string name = uq.GetName(); // delete query if (uq.Delete(true)) { no = 1; } } return(Json(no)); }