Writing output from code

This example shows how to output Html from within a code block by using the Write and WriteLine methods.

Important

Smartsite 7.5b1 contains an Html encoding bug in the Write method. The Write method does not properly encode the input value. This will be fixed in 7.5b2 and later.

Smartsite SXML CopyCode image Copy Code
@using System
@{
    Write(999);
    WriteLine(123);

    WriteLine(true);
    WriteLine("hi");
    WriteLine(3.1415);
    WriteLine(Int64.MaxValue);
    WriteLine(new DateTime(2016,4,30,12,34,56));
}