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 All,
I have been using umbraco for a while but new to Razor. I have managed to write some simple razor scripts to get and check property values but am wondering how you can set a node property or attribute values in razor.
Cheers,
Hi Bob,
Welcome to Our!
It is the job of the content service to write values. While it will work in Razor it is generally the job of a controller to perform such operations.
There are tutorials on both controllers and the content service at Umbraco.tv that I would recommend.
http://umbraco.tv/videos/developer/fundamentals/surface-controllers/introduction/ and http://umbraco.tv/videos/developer/fundamentals/content-api/introduction/
Jeavon
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Setting Property Values using Razor
Hi All,
I have been using umbraco for a while but new to Razor. I have managed to write some simple razor scripts to get and check property values but am wondering how you can set a node property or attribute values in razor.
Cheers,
Hi Bob,
Welcome to Our!
It is the job of the content service to write values. While it will work in Razor it is generally the job of a controller to perform such operations.
There are tutorials on both controllers and the content service at Umbraco.tv that I would recommend.
http://umbraco.tv/videos/developer/fundamentals/surface-controllers/introduction/ and http://umbraco.tv/videos/developer/fundamentals/content-api/introduction/
Jeavon
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.