ASP.NET Tutorials

HTTP

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.

Writing data

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.Write Test.

See Response.WriteFile Method.

See Response.BinaryWrite Test.

See Image Output.

HTTP headers

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 Set ContentType.

See Response Redirect Method.

See Response RedirectPermanent Method.

See Request.Headers Usage Stats.

ASHX files

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.

See ASHX Handler Tutorial.

Using tracing

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.

See Trace Examples and Tips.

Rewriting paths

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 RewritePath Method Usage.

See urlMappings for Redirects.

See Server.Transfer Method.

Using QueryString

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.

See QueryString Usage.

Using HttpContext

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.

Configuration

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 HTTP Pipeline.

See Precompiled Site Options.

See Remove httpModules.

See Web Application Project Comparison.

See appSettings Example.

See X-Aspnet-Version Header.

Using HttpWorkerRequest

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.

See Get HttpWorkerRequest.

See HttpWorkerRequest Use.

Server-side includes

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.

See SSI Server Side Includes.

AJAX example

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.

See Page_Load Event and AJAX.

Custom methods

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.

See Domain Name String Method.

See Localhost Method.

See Sitemap Recursion.

© 2007-2010 Sam Allen. All rights reserved.

Dot Net Perls  Sam Allen