Just writes the '@Umbraco.Field("subTitle")' to the browser.
Can anyone shed any light on this? What am I missing? Just so you know my set up...if it makes any diffrence I am using WebMatrix 2 installed umbraco using the web-platform installer.
I have one document type and one template with no children...I am writing the Razor directly in to this template.
using @Umbraco.Field("subTitle") is the Mvc Syntax,
You can switch to Mvc by changing the defaultRenderingEngine setting in umbracosettings.config (in the config folder) - then create your template and it will be created as a MVC template.
Why can't I use Razor?
Hey guys,
I'm working on my first umbraco 6 Project its fairly simple, just a one page website, with it's contents controled by umbraco.
So far its not going to badly apart from one major thing, I don't seem to be able to use Razor syntax, for example,
<p class="par-name"><umbraco:Item field="subTitle" runat="server" /></p> this seems to work,
but....
<p class="par-name">@Umbraco.Field("subTitle");</p>
Just writes the '@Umbraco.Field("subTitle")' to the browser.
Can anyone shed any light on this? What am I missing? Just so you know my set up...if it makes any diffrence I am using WebMatrix 2 installed umbraco using the web-platform installer.
I have one document type and one template with no children...I am writing the Razor directly in to this template.
Thanks in Advance
Ayo
hi
i think you are mixing traditional web forms and MVC syntax.
You can run razor inline in web forms you just need to enclose it in a macro tag
using @Umbraco.Field("subTitle") is the Mvc Syntax,
You can switch to Mvc by changing the defaultRenderingEngine setting in umbracosettings.config (in the config folder) - then create your template and it will be created as a MVC template.
is working on a reply...