How to collect data in a form with ASP .NET Webforms?

0

I'm doing an ASP .NET Webforms form

When designing the form it is best to do it with HTML tags only or it must be done mixing the ASP Webforms object tools

In other words, for the form and the buttons I can do it in HTML:

<form id="pasoForm" action = "respuesta.html" method = "post" >
<input type = "submit" name = "boton1" id = "boton1" class ="ir-btn" />
</form>

Or using the ASP Standard objects

<form id="pasoForm" runat="server">
<asp:Button  runat="server" Text="boton1" ID="boton1"></asp:Button>
</form>


<form id="pasoForm" runat="server">
<button type="button" name="boton1" id="boton1" class="ir-btn" onclick="step1()">Continuar</button> 
</form>
    
asked by Popularfan 20.07.2018 в 11:17
source

1 answer

2

You can use both ways, if you want to retrieve the data with the ASP form the fields will appear as controls in the code behind, if you want to use is html you can use the attribute runat="server" so that the id appears in the code behind too.

<input type = "submit" runat="server" name = "boton1" id = "boton1" class ="ir-btn" />

My opinion would be to do this with ajax, since with this method you will have to refresh the screen and the application will not be very responsive.

You can see how to do this in the following Link

    
answered by 30.07.2018 / 22:14
source