ASP.NET Web Pages - Helpers

Web Helpers greatly simplifies web development and common programming tasks.

ASP.NET Helpers

ASP.NET helpers are components that can be accessed by single lines of Razor code.

You can build your own helpers using Razor syntax stored as .cshtml files, or use built-in ASP.NET helpers.

You will learn how to use Razor helpers in the next chapters of this tutorial.

Below is a short description of some useful Razor helpers:

The WebGrid Helper

The WebGrid helper simplifies the way to display data:

  • Automatically sets up an HTML table to display data
  • Supports different options for formatting
  • Supports paging (First, next, previous, last) through data
  • Supports sorting by clicking on column headings

The Chart Helper

The "Chart Helper" can display chart images of different types with many formatting options and labels.

chart chart

The Chart helper can display data from arrays , from databases, or from files.

The WebMail Helper

The WebMail helper provides functions for sending email messages using SMTP (Simple Mail Transfer Protocol).

The WebImage Helper

The WebImage helper provides functionality to manage images in a web page.

Keywords: flip, rotate, resize, watermark.

Third Party Helpers

With Razor you can take advantage of built-in or third party helpers to simplify the use of email, databases, multimedia, and social networks as well as many other issues like navigation and web security.

Installing Helpers

Some helpers are already included with WebMatrix, but you can install others as well.

In the W3Schools Helper Reference you can find a quick reference for included helpers and other helpers that you can install as part of a package called the ASP.NET Web Helpers Library.

If you have a web site created in WebMatrix, use the following procedure to install helpers:

  1. In WebMatrix, open the Site workspace.
  2. Click on Web Pages Administration.
  3. Login to Web Pages Administration using a password *.
  4. Search for helpers using the search field.
  5. Click install to install your desired helpers. 

(* the first time you use Web Pages Administration, it will prompt you to create a password)