You can create functions in Razor (C#) for more complex operations:
@functions{ private string HelloWorld(){ return "Hello world!"; } } @{ System.IO.File.WriteAllText("C:\\MyFolder\\MyFile.txt", HelloWorld()); }
Powered by Revindex Wiki