1
I have a.aspx page that I have several Forms. One of the Forms put runat="server" and you’re like Textbox, I was able to take the form data and insert it into the database. But I wanted to do the same with the other forms, but I don’t know how to do that. Yeah, can’t have more than one form server="runat" on the same page.
How do I receive data from other Forms in my class?
Follow the codes of my forms:
<!-- Modal Veículos -->
<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>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_cliente">Salvar</Button>
</div>
</form>
</div>
<!-- Modal Clientes -->
<div id="myModal_Clientes" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<form id="clientes" runat="server">
<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>Nome </label><asp:TextBox id="nome_clientes" runat="server"></asp:TextBox>
<label>CPF </label><asp:TextBox id="cpf_clientes" runat="server"></asp:TextBox>
<label>RG </label><asp:TextBox id="rg" runat="server"></asp:TextBox>
<label>Endereço </label><asp:TextBox id="endereco" runat="server"></asp:TextBox>
<label>Telefone </label><asp:TextBox id="telefone" runat="server"></asp:TextBox>
<label>E-mail </label><asp:TextBox id="email_clientes" runat="server"></asp:TextBox>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Fechar</button>
<asp:Button class="btn btn-primary" Text="Salvar" runat="server" onclick="button1_cad_cliente"></asp:Button>
</div>
</form>
</div>
Friend, your question contains typos is runat="server", and then how will a form be of the Textbox type? Unless it is A <form> field... Finally checks and...
– Bruno Casali
But the Texbox, if you look closely, is wrapped in a form.
– Vinícius
Yes, that’s seen, is that you had said it incorrectly!
– Bruno Casali
The link you sent is similar to my doubt. But it was not enough to remove my doubt. But it was worth.
– Vinícius
Take a look again... I did an update.!
– Bruno Casali