3
I have a view layout:
<div>
<h1>Pagina Principal<h1>
</div>
<div>
<h3>Simular<h3>
</div>
<div class="row">
@{Html.RenderPartial("Partials/Teste/Simular", new SimularViewModel(cpf: Model.Cliente.Cpf, idCampanha: Model.Ocorrencia.IdCampanha));}
</div>
<div>
<h3>opções<h3>
</div>
<div class="row">
@{Html.RenderPartial("Partials/Cadastro/_Opcoes", new CadastroViewModel(cpf: Model.Cliente.Cpf, idCampanha: Model.Ocorrencia.IdCampanha));}
</div>
Containing 2 partials views:
Simulate
<div>
<label>texto</label>
<label>texto</label>
</div>
<div>
@Html.ActionLink("Ir para Simulação", "Index", "Simular",
new { cpf = Model.Cpf, origem = ViewBag.Origem},
new { @class = "btn btn-brand float-right btn btn-brand float-right" })
</div>
Register
<div>
@Html.DropDownListFor(model => model.Status, Model.StatusOcorrencias.Select(so => new SelectListItem() { Text = so.Status, Value = so.Id.ToString() }), "Selecione", new
{
@class = "form-control m-input m-input--square",
@id = "dllStatus",
style = "width: 100%"
})
</div>
<div>
@Html.TextAreaFor(x => x.Observacao, new { @class = "form-control m-input", maxlength = "500" })
</div>
I kind of drew it like layout:
I need to pass the information of the fields that can be filled out by the user on partial view 2 Cadastrar
, to the button ActionLink
of partial view 1 Simular
.
How to do this?
How the variable scope works in this case?
And if there’s any way I can return the value of partial to the view main and the view main to the partial?