0
I would like to know how I can change the value of @Model still in the view, before sending to the server and which the best way to do this?
Example:
@{ var model = (Pessoa)Model bool isAtivo = pessoa.IsAtivo } @Html.TextBox("Ativo", @isAtivo, new{...}) Alterar Salvar
And if my item is a string as it should be done?
Example 2:
@{ var model = (Pessoa)Model string nome = pessoa.Nome } @Html.TextBox("Ativo", @nome, new{...}) Alterar Salvar
What is the purpose of this?
– Leonel Sanches da Silva
The example shown is only demonstrative.. because I actually have an object list where I want to change the (bool)status of the objects on my list without requesting the server for each change...
– Eluander J. F. Lopes
Ah, so come on. You have a list of objects on
@Model
. You want to change the status of some of her items. It is only on screen or the change has to reflect immediately on server?– Leonel Sanches da Silva
First I want to modify everything on screen and then is forwarding my ready list to the server;
– Eluander J. F. Lopes