Creating Basic Form

Let's take a look at Add.cshtml.

  1. The form uses "post" method to send the form values.
  2. There are class tags that relate to CSS boostrap syntax.
  3. "col-md-6" means it will use 6 out of 12 parts of the page to display the content.
  4. Notice "for" element in HTML tag. It is used to tell the browser that this label is for the input element whose ID is date.
  5. Notice "name" element in HTML tag. It is used to reference elements after the form is being submitted.
  6. Try to run Add.cshtml and fill the Date input as 1/1/2016.
  7. Check the Network tab in inspect element to get a brief look at how the form is being submitted.
  8. Take a quick look at difference of GET and POST method here: https://www.w3schools.com/tags/ref_httpmethods.asp

results matching ""

    No results matching ""