MVC4 modify a model parameter of a partial view, from another controller

0

Please if anyone could help me modify the property value of a partial view model. The problem is the following I have the view A that invokes the partial view A1.

I call the partial @Html.Action("Child", "Token")

in the controller of the caller I try to modify a model property of the partial view

   public ActionResult FinTransacc(Object Aux) {

                if (Aux.token != "999999")
                {
                    Aux.mensaje = "Es invalido";
                    return View("Confirmacion", Aux);
                }
            }

but on reaching the partial view controller that assignment Aux.message="It is invalid"; always comes null.

How could you modify this property value of the partial view model.

    
asked by Osmar Murillo 13.12.2016 в 22:05
source

1 answer

0

Well friend your question is somewhat confusing it seems that what you want is to send a message. You could use ViewData , < a href="https://msdn.microsoft.com/en-us/library/system.web.mvc.controllerbase.viewbag(v=vs.118).aspx"> ViewBag or TempData to pass messages between views or controllers reviews the documentation of these.

I hope my answer will be helpful.

    
answered by 13.12.2016 / 22:59
source