IsPost Property in ASP.NET & HTTP GET and POST Methods

The HTTP protocol (used for web pages) supports a very limited number of methods (verbs) that are used to make requests to the server. The two most common ones are GET (which is used to read a page), and POST (which is used to submit a page). In general, the first time a user requests a page, the page is requested using GET. If the user fills in a form and then clicks a submit button, the browser makes a POST request to the server.

In web programming, it's often useful to know whether a page is being requested as a GET or as a POST so that you know how to process the page. In ASP.NET Web Pages, you can use the IsPost property to see whether a request is a GET or a POST. If the request is a POST, the IsPost property will return true, and you can do things like read the values of text boxes on a form.

No comments:

Post a Comment