public ActionResult SaveSearchQueryOrUpdate(SearchBL.ManageQuery Model, FormCollection Collection) { if (Model != null) { if (Model.Autosearch == true) { if (!string.IsNullOrEmpty(Collection["ddlUserSubTopic"])) { Session["SavedQueryDet"] = null; Model.resultFolder2 = Convert.ToInt32(Collection["ddlUserSubTopic"]); Session["SavedQueryDet"] = SearchBL.UpdateSearchQuery(Model); return(RedirectToAction("SaveQuery_Complete", "Search", new { SearID = Model.SearchId, subtopicID = Model.resultFolder2 })); } else { alert(new MyResult() { Tittle = "Save Query", Message = "Please specify a destination folder.", restype = false }); return(RedirectToAction("SaveSearchQuery", "Search", new { searchinfo = Model.QueryDetails, Sid = Model.SearchId })); } } else { Session["SavedQueryDet"] = null; Session["SavedQueryDet"] = SearchBL.UpdateSearchQuery(Model); return(RedirectToAction("SaveQuery_Complete", "Search", new { SearID = Model.SearchId, subtopicID = Model.resultFolder2 })); } } return(View(Model)); }