Posted 14 December 2022, 8:53 am EST - Updated 14 December 2022, 8:59 am EST
I have a problem saving the order of my Grid in my DataBase. I save the order with JavaScript using the property “.columnLayout” and i send the String to the controller where I save it at the DataBase.
My code is working in local code debugging but when I upload It to the server It gives an error 403
JS
function guardarOrdenColumnas() {
var grid = wijmo.Control.getControl("#theFlexGrid");
var orden = grid.columnLayout;
window.location.href = "@Html.Raw(Url.Action("GuardarOrdenColumnas", "tareas", new { ordenCol = "replaceToken", programa = "TareasPendientes"}))".replace("replaceToken", orden);
}
Controller
public ActionResult GuardarOrdenColumnas(String ordenCol, String programa)
{
var usuario = HttpContext.Session.GetString("usuario");
FicOrdenCol objOrdencol = new() {
ordenColGrid = programa,
ordeColOrden = ordenCol,
ordenColUsuario = usuario,
};
try
{
if (dbContext_ordenCol.LeerFicOrdenColExiste(programa, usuario))
{
dbContext_ordenCol.ActualizarFicOrdenCol(objOrdencol, usuario);
switch (programa)
{
case "Tareas": return RedirectToAction("Index");
case "TareasPendientes": return RedirectToAction("IndexTareasPendientes");
case "CierreTareasPendientes": return RedirectToAction("IndexCierreTareasPendientes");
case "TareasDesviaciones": return RedirectToAction("IndexTareasDesviaciones");
case "TareasMes": return RedirectToAction("IndexTareasMes");
case "TareasParteFondeo": return RedirectToAction("IndexTareasParteFondeo");
}
}
else
{
dbContext_ordenCol.CreateFicOrdenCol(objOrdencol, usuario);
switch (programa)
{
case "Tareas": return RedirectToAction("Index");
case "TareasPendientes": return RedirectToAction("IndexTareasPendientes");
case "CierreTareasPendientes": return RedirectToAction("IndexCierreTareasPendientes");
case "TareasDesviaciones": return RedirectToAction("IndexTareasDesviaciones");
case "TareasMes": return RedirectToAction("IndexTareasMes");
case "TareasParteFondeo": return RedirectToAction("IndexTareasParteFondeo");
}
}
return View();
}
catch (Exception e) {
return RedirectToAction("Index");
}
}
Could it be a server configuration?