Namespace: System.Web
Contains classes and interfaces that provide functionality for building ASP.NET Web applications.
Namespaces within System.Web
- System.Web.Http Provides classes for building HTTP services.
- System.Web.UI Provides classes for creating Web user interfaces.
- System.Web.Routing Provides classes for URL routing in ASP.NET.
- System.Web.Services Provides classes for building Web services.
- System.Web.SessionState Provides classes for managing user session state.
Core Types in System.Web
- HttpRequest Encapsulates information about an incoming HTTP request.
- HttpResponse Encapsulates the HTTP response to be sent to the client.
- HttpContext Encapsulates all information about an individual HTTP request.
- IHttpHandler Defines the interface that all HTTP handlers must implement.
- IHttpModule Defines the contract for HTTP modules.
- UrlHelper Provides methods for generating URLs.
Frequently Used Classes
-
HttpUtility
Provides methods for escaping and returning strings that are encoded for use in HTML or URLs.
Static Methods:
HttpUtility.UrlEncode(string s)
Encodes a string that has been encoded with a URL encoding scheme.
HttpUtility.HtmlEncode(string s)
Encodes a string that contains HTML characters.
-
HttpResponse
Encapsulates the HTTP response to be sent to the client.
Properties:
string ContentType
Gets or sets the content type of the response.
int StatusCode
Gets or sets the status code of the response.
Methods:
void Write(string s)
Writes a string to the HTTP output stream.