ASP.NET implements a framework developed by Microsoft that you can use to serve web pages. It provides many ways to render web pages and send them to browsers, but this section focuses on the aspects of ASP.NET that can be used independently of the HTML generation itself. Using the examples in these articles, we explore the ASP.NET framework with a focus on the C# language.
With ASP.NET, you need to receive the request from the web browser over the network, and then generate a response to send back. You can use the BinaryWrite, Write, or WriteFile methods for this.
See Response.WriteFile Method.
See Response.BinaryWrite Test.
HTTP headers are an instrumental part of the web: client software sends requests in HTTP header format, and your web server must respond with the appropriate HTTP response headers and the response itself. These articles describe how to use HTTP headers in ASP.NET.
See Response RedirectPermanent Method.
See Request.Headers Usage Stats.
While many websites use ASPX files, which represent pages, you can also use ASHX files, which are simple handlers. None of the overhead associated with the Page class is present here; this article reveals more information about the ASHX format.
Tracing is an easy way to build diagnostics and timings into your ASP.NET website. It is also easy to disable in case you need more performance from your site after development.
Often, the path received from the client on the network is not the same as the path on the local server. In ASP.NET, you can dynamically rewrite paths such that the correct server path is always used for external requests.
See urlMappings for Redirects.
When you access an ASP.NET website with a query string in the URL, such as page.aspx?test=1, the QueryString collection may be used in the C# language to access the "test" value. This article covers the QueryString collection with a fair level of completeness.
The HttpContext type is essential to ASP.NET development as it provides functionality related to the HTTP protocol and the current request and response on the server. These tutorials dive into the HttpContext type.
See HttpContext Request Property.
See HttpContext Timestamp Property.
See IsDebuggingEnabled Property.
Configuring ASP.NET websites is one of the most frustrating part of developing them. These articles span several configuration topics: you can change error outputs, how the site is compiled, what modules are loaded, and the settings used in the website.
See Custom Error Pages Tutorial.
See Web Application Project Comparison.
One way you can improve the performance of your ASP.NET programs is with the HttpWorkerRequest class. This gives you a lower-level mechanism to access important data, and also to output certain headers and data.
Server-side includes are a IIS feature in that they are processed separately from ASP.NET. They are useful for performance simple substitutions on pages as they are accessed. This can help you separate parts of pages in development.
With AJAX, you can update pages on the client side without needing to change the entire page. You can simply update parts of pages, as we show in this example that ties the Page_Load event to the AJAX technique.
Some methods relevant to ASP.NET development are not built-in and must be added by developers. This section lists some custom methods that can be used in ASP.NET websites.