Hello,
To follow up, I've tried the following from this article:
http://maxiomtech.com/cms/stop-using-tokens-just-use-razor/
I've referenced DotNetNuke.Web.Razor.dll
I created a class:
public class MyClass
{
public string MyProperty { get; set; }
}
Then included the following code:
string templatePath = ControlPath + "Templates/Example.cshtml";
var razorEngine = new DotNetNuke.Web.Razor.RazorEngine(templatePath, ModuleContext, LocalResourceFile);
var writer = new StringWriter();
razorEngine.Render(writer, new MyClass {MyProperty = "Fred"});
placeHolderOutput.Controls.Add(new LiteralControl(Server.HtmlDecode(writer.ToString())));
But what to write in the Razor file 'Example.cshtml'?
I can only get plain text written into the page.
As the article states, I've tried inherits but the class isn't recognised:
@inherits DotNetNuke.Web.Razor.DotNetNukeWebPage<MyClass>
Can anyone please put me out of my misery :-)
Steve