How do I define a method in Razor?
C# – How to define a method in Razor
asp.net-mvcasp.net-mvc-3crazor
Related Topic
- C# – Why is it important to override GetHashCode when Equals method is overridden
- C# – How to mark a method as obsolete or deprecated
- How to import a namespace in Razor View Page
- Escape @ character in razor view engine
- How to use ternary operator in razor (specifically on HTML attributes)
- Asp.net-mvc – Writing/outputting HTML strings unescaped
- Javascript – Using Razor within JavaScript
- C# – How to declare a local variable in Razor
Best Answer
Leaving alone any debates over when (if ever) it should be done, @functions is how you do it.