How to handle multiple forms on the same page.aspx?

1

I have a page.aspx that I have several forms. One of the forms I placed runat="server" and is of type Textbox , I was able to get form data and insert it into the database. But I wanted to do the same with the other forms, but I do not know how to do that. Well, it's not possible to have more than one form server="runat" on the same page.

How do I get data from other forms in my class?

Here are the codes for my form's:

<!-- 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>
    
asked by anonymous 22.09.2014 / 16:02

1 answer

1

Dude, take a look at my comment too, but to answer your question is simple!

Take a look at this link , which will heal your doubts!

Thanks! : D

UPDATE 01

You must set an action and a method in the form that does not have runat="server", because asp net does not allow two forms with runat="server", operating on the same page.

I suggest that you analyze your structure and create a WebUserControl, or move one of these forms to another aspx page. And it is not possible to recover the values of these two forms on this same page! : D

Understand?!

    
22.09.2014 / 20:50