How to use the value of an HTML field inside the code behind C #?

1

I have a JavaScript code that makes creating HTML fields in an ASP.NET page. How do I call the function for the Code Behind and return to the created fields? If I could use ASP.NET in this case, I would have to create multiple Textbox and manipulate the value on the server.

<input type="text" onblur="pesquisa(this.name, 1)" maxlength="10" size="10" value="" name="contrato1" onkeypress="FiltraTecla(event);">
    
asked by anonymous 05.07.2015 / 23:16

1 answer

1

Enter a name for the element, then in the code-behind use Request.Form["nomeDoElemento"] to get it.

For example, if the JavaScript code creates an element

<input type="text" name="nomeDoCliente" />

The value of this field can be obtained in code-behind as follows:

string cliente = Request.Form["nomeDoCliente"];
    
12.07.2015 / 02:42