Dynamic content can be added to your website with the
assistance of helpers within the code. Helpers are part of the ASP.NET Helpers
Library that must be installed prior to use. Helpers are often a single line of
code. For example, to add a Twitter feed to a website, the helper code is as
simple as:
< h1 >Twitter Feed< /h1 >
@Twitter.Profile(“Microsoft”)
< /body >
Another helper to WebMatrix content is Razor Syntax. Razor
Syntax is an easy-to-use, server-based programming syntax that is embedded in a
web page. This ASP.NET-based syntax relies on the Microsoft .NET programming
framework and can be used in the development of a wide range of web content.
Razor Syntax code can be imbedded in the following three
ways:
1.
As an inline expression using “@”.
2.
As a single statement block.
@{var VariableOne = "Hello World!";}
3.
As a multi-statement block.
@{
string VariableTwo = VariableOne + " Today is: " + @DateTime.Now;
}
Those familiar with C, C++, C#, JavaScript, or Visual Basic
should do well with RazorSyntax. Microsoft provides extensive online and
published resources and support towards the use of this language. The ASP.NET
website is a good place to start. For those starting with Razor Syntax, an
excellent online resource can again be found at the Microsoft ASP.NET website.