Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I'm new to umbraco and I know that my question is pretty basic but I can't find an answer to it, so please be patient.
I'm having a trouble in understanding how can I use the content of a template/doctype in a view and to pass it to a SurfaceController.
I've added a doctype and a template for it via umbraco back office and I got the basic cshtml file:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
Layout = null;
}
My doctype which is associated with this cshtml file has two properties "apikey" and "basekey" (they're not empty)
When I try to access these properties using @Model.apikey I get an exception.
What am I missing? how can I reach the content using Razor?
I'd be more than happy if you can refer me to a site/touturial that answers my question.
Thank Guys,
Alaa
Hi, can you show me what code you have tried so far? You can get to the context node using @Model.Content....
and then do .getProperty("apikey"); for example. Hope this helps.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Access content(Model) using Razor in template view and passing it to SurfaceController
Hi,
I'm new to umbraco and I know that my question is pretty basic but I can't find an answer to it, so please be patient.
I'm having a trouble in understanding how can I use the content of a template/doctype in a view and to pass it to a SurfaceController.
I've added a doctype and a template for it via umbraco back office and I got the basic cshtml file:
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@{
Layout = null;
}
My doctype which is associated with this cshtml file has two properties "apikey" and "basekey" (they're not empty)
When I try to access these properties using @Model.apikey I get an exception.
What am I missing? how can I reach the content using Razor?
I'd be more than happy if you can refer me to a site/touturial that answers my question.
Thank Guys,
Alaa
Hi, can you show me what code you have tried so far? You can get to the context node using @Model.Content....
and then do .getProperty("apikey"); for example. Hope this helps.
is working on a reply...