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>
That contains 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 drew more or less how the layout is:
I need to pass the information of the fields that can be populated by the user in the partial view 2 Cadastrar
, to the ActionLink
button of the partial view 1 Simular
.
How to do this?
How does the scope of the variable work in this case?
And if I have to return the value of the partial for the main view and the main view for the partial in>?