*
I have this error with my action. Error My Controller
[Authorize(Roles = ApplicationRoles.PAINELCHAMADA_EDITAR)] public ViewResultBase Editar(int IdEmpresa, int id) { var model = this.Service.Get(IdEmpresa, id); return base.PartialView(model); } [HttpPost] [Authorize(Roles = ApplicationRoles.PAINELCHAMADA_EDITAR)] public ActionResult Editar(PainelChamada item) { if (this.ModelState.IsValid) { try { this.Service.Update(item, this.GetFieldsToUpdate()); return RedirectToAction("Index"); } catch (ValidationException exception) { base.AddValidationErrors(exception); return base.View(item); } } else { return base.View(item); } }
View @model PainelChamada @{ this.ViewBag.Title = PainelChamadaResource.Titulo; this.ViewBag.SubTitle = Geral.Editar;
} @using (Html.BeginForm( this.DefaultActionEdit, "PainelChamada", "POST")) //new AjaxOptions //{ // InsertionMode = InsertionMode.Replace, // HttpMethod = "POST", // UpdateTargetId = "content" //})) { @Html.ValidationSummary() @Html.HiddenFor(i => i.Id)<input type="submit" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" value="Alterar" /> } what might be happening? I try create routes in GlobalAsax, but no have success.
*
public ViewResultBase Editar(int IdEmpresa, int id)
. IsIdEmpresa
null? – alex