What does the Request.Form ["codproduct"] do on asp.net?

1

I saw the following code on the internet:

Request.Form ["codproduct"]

but I do not know what the function of Request.Form is and the co-product it represents?, I would appreciate your explanation and its use.

    
asked by lucho 13.03.2018 в 22:10
source

1 answer

0

Taken from the Mozilla Foundation:

  

HTML forms are one of the main points of interaction between a user and a website or application. They allow users to send information to a website. Most of the time, information is sent to a web server, but the web page can also intercept it to use it on its own.

     

An HTML form is made up of one or more widgets. These widgets can be text fields (of a line or multiline), selection boxes, buttons, checkboxes, or radio buttons. Most of the time, these widgets are next to a label that describes their purpose.

All HTML forms start with the element as follows:

<form action="/my-handling-form-page" method="post">

</form>

So, basically when the form makes a post to the server, all the inputs that are inside the FORM are sent to the server in a collection of key string value string .

When you see Request.Form["codproducto"] you are seeing how the server is trying to read a value that was posted under the name "codproduct". For example

<form action="/my-handling-form-page" method="post">
    <input name="codproducto" type="text">
</form>
    
answered by 13.03.2018 / 22:17
source