0
I am trying to recover the values of a form. This is the correct way to retrieve them to pass to my DAL?
<div id="myModal_Veiculos" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<form id="Cad_Veiculos">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Cadasto de Clientes</h3>
</div>
<div class="modal-body">
<label>Modelo </label><input type="text" name="modelo" id="modelo" />
<label>Placa </label><input type="text" id="placa" name="placa" />
<label>Quilometragem </label><input type="text" id="quilometragem" name="quilometragem" />
<label>Cor </label><input type="text" name="cor" id="cor" />
<label>Tipo </label><input type="text" name="tipo" id="tipo" />
<label>Ano </label><input type="text" name="ano" id="ano" />
<label>Chassi </label><input type="text" name="chassi" id="chassi" />
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Fechar</button>
<Button class="btn btn-primary" onclick="button1_cad_veiculo">Salvar</Button>
</div>
</form>
</div>
Retrieving the values from the form
protected void button1_cad_veiculo(object sender, EventArgs e)
{
Veiculo vl = new Veiculo();
vl.Modelo1 = Request.Form["modelo"];
vl.Quilometragem1 = Request.Form["quilometragem"];
vl.Placa = Request.Form["placa"];
vl.Cor = Request.Form["cor"];
vl.Chassi = Request.Form["chassi"];
vl.Tipo = Request.Form["tipo"];
VeiculoDAL.cadastra(vl);
}
The problem with using runat is that I can only use one <form runat="server">, and I’m already using it. That’s why I’m after another way to recover the values of this modal.
– Vinícius
Bruno, can you give me a hand here?
– Vinícius
Could you bring these images to the site? These links may become invalid over time and response will also stay.
– Maniero
I can’t do it anymore! my C# Workspace has been removed from my machine, but I took the advice! thanks!
– Bruno Casali