This question is locked. New answers and comments are not allowed.
Hi, currently I have to write 2 actions to send me the same result:
one for my form post
other for grid ajax bind.
look:
There is a way to know if the action is called from one or from other ?
Thanks.
one for my form post
other for grid ajax bind.
look:
public ActionResult Pesquisar(PrestadorFiltro filtro = null) { if (Session["token"] == null) return RedirectToAction("Index", "Home"); if (filtro == null) filtro = new PrestadorFiltro { Nome = null, Estado = null }; DataSet prestadores = consultaPrestador.PesquisarPrestadorFiltroCompleto( Session["token"].ToString(), filtro.Estado, filtro.Municipio != null ? Int32.Parse(filtro.Municipio) : 0, 0, 0, 0, filtro.Nome, null, 0, 0, null); Session["ultimoFiltro"] = filtro; return PartialView("_GridPesquisa", prestadores.Tables.Count > 0 ? prestadores.Tables[0] : null); } [GridAction] public ActionResult AjaxPesquisar() { PrestadorFiltro ultimoFiltro = Session["ultimoFiltro"] as PrestadorFiltro; DataSet prestadores = consultaPrestador.PesquisarPrestadorFiltroCompleto( Session["token"].ToString(), ultimoFiltro.Estado, ultimoFiltro.Municipio != null ? Int32.Parse(ultimoFiltro.Municipio) : 0, 0, 0, 0, ultimoFiltro.Nome, null, 0, 0, null); return View(new GridModel(prestadores.Tables.Count > 0 ? prestadores.Tables[0] : null)); }There is a way to know if the action is called from one or from other ?
Thanks.