ASP.NET Request object
In ASP.NET, the Request
object is a server-side object that’s used to retrieve information sent by the client (usually a web browser) to the web server. It provides access to various data types, including form data, query parameters, cookies, headers, and so on. The Request
object is essential to processing client requests and building dynamic web applications in ASP.NET.
The Request
object is accessible in all ASP.NET page types, including ASPX pages, code-behind files, and custom handlers. It is available by default, and you can use it directly without creating an instance.
Here are some common properties and methods of the Request
object in ASP.NET. They are very close to the Classic ASP properties and methods:
- Form collection (
Request.Form
): Provides access to the data sent to the server using the HTTP POST method (usually from HTML forms).Example:
Request.Form["username"]
returns the value submitted with the input field named...