Reputation: 3749
The example I'm using is literally the one from their example page here: https://github.com/NancyFx/Nancy/wiki/The-Super-Simple-View-Engine
So I have my files set up with index.sshtml
and master.sshtml
(copy/pasted verbatim from the example) in the root, and serving up the result with:
Get["/"] = result => View["index.sshtml"];
When I then go to visit localhost in my browser I get a text simply saying "[ERR!]", instead of the "This is content on the index page" which I had expected.
What am I doing wrong? Is there something I have to explicitly do to enable the Master/Section functionality of the SSVE?
Edit: Views:
master.sshtml
<html>
<body>
@Section['Content'];
</body>
</html>
index.shtml
@Master['master.sshtml']
@Section['Content']
This is content on the index page
@EndSection
File structure:
+ Debug
|---ConsoleApplication1.exe
|---index.sshtml
|---master.sshtml
|---(rest of files Visual Studio outputs)
I'm pretty sure this is the simplest example that could possibly work, and for some reason, it doesn't. There are no (uncaught) exceptions thrown, not output in the debug window, and no other indications that something has gone awry, except for the [ERR!] being printed. It is the only content being printed, so I'm assuming it's something in the "Master" block that is failing...
Upvotes: 4
Views: 1327
Reputation: 49
In my case I had to:
sshtml
file in another text-editor, change the encoding to ``UTF-8 no BOM``` thenReload all
and everything should be good.Upvotes: 0
Reputation: 7712
In case someone else sees this, make sure that all .sshtml files are marked as 'Copy to Output Directory" : 'Copy Always' under File Properties
Upvotes: 4