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
I am currently using Razor scripts extensively, and I have a lot of repeating codes.
How can I create reusable funcrtion and shared by multiple scripts? I know how to do in ASP.NET MVC Razor engine, but how about in Umvbraco?
Youc could use:
Extension Methods:
http://umbraco.com/follow-us/blog-archive/2011/2/28/umbraco-razor-feature-walkthrough-%E2%80%93-part-3
@RenderPage and Global helpers:
http://joeriks.com/2011/03/11/better-structure-for-your-razor-scripts-with-renderpage-in-umbraco/
Thanks
M
Great, the global helpers in your 2nd post is exactly what I am looking for!
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
Reusable Function in Razor
I am currently using Razor scripts extensively, and I have a lot of repeating codes.
How can I create reusable funcrtion and shared by multiple scripts? I know how to do in ASP.NET MVC Razor engine, but how about in Umvbraco?
Youc could use:
Extension Methods:
http://umbraco.com/follow-us/blog-archive/2011/2/28/umbraco-razor-feature-walkthrough-%E2%80%93-part-3
@RenderPage and Global helpers:
http://joeriks.com/2011/03/11/better-structure-for-your-razor-scripts-with-renderpage-in-umbraco/
Thanks
M
Great, the global helpers in your 2nd post is exactly what I am looking for!
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.