0
I wanted to know how to take the value of my variable tempData and put in an html input, in value maybe... someone could help me?
Code below:
<div class="container-fluid">
<form method="post" style="margin: 0 auto; padding: 25px; background-color:white;">
<input type="hidden" name="DataHora" id="DataVotacao" value="" readonly />
<input type="text" name="IdFuncionario" id="DataVotacao" value="@(ViewBag.Funcionario)" readonly />
<div>
<label for="Senha">Recurso:</label>
@Html.DropDownList("IdRecurso", (IEnumerable<SelectListItem>)ViewBag.Recurso)
</div>
<div>
<label for="Comentario">Comentário(obrigatório):</label>
<textarea name="Comentario" required="required"></textarea>
</div>
<div>
<button type="submit" name="ConfirmaPassword" class="btn-primary btn-block" style="position:center">Cadastrar</button>
</div>
</form>
</div>
If you have the code?
– novic
If you’re saying Idfuncionaio?
– novic
Exactly... I want to put in that input, idFunctioning, the numerical value of Id that I have allocated in my Viewbag.Functioning. Or if I should store the Value in Tempdata to use there
– Thiago Oliveira
It worked Thiago the answer?
– novic
It did, but there’s a problem.. Viewdata and Viewbag get lost after 1 redirect, right?
– Thiago Oliveira
It depends what you’re doing, I posted the example, but, it seems that your reality is different, the big problem of the questions are those are never complete, but for what you asked is what I posted! got it
– novic
as much as the situation has a somewhat specific purpose, it served to clarify something yes and I am very grateful inclusive!
– Thiago Oliveira