Leaving alone any debates over when (if ever) it should be done, @functions is how you do it.
@functions {
// Add code here.
}
More Related Contents:
- How to render a Razor View to a string in ASP.NET MVC 3?
- Razor: Declarative HTML helpers
- ASP.NET MVC DropDownListFor with model of type List
- asp.net-mvc: razor ‘@’ symbol in js file
- Possible to access MVC ViewBag object from Javascript file?
- How to declare a local variable in Razor?
- MVC 3: How to render a view without its layout page when loaded via ajax?
- How to retain spaces in DropDownList – ASP.net MVC Razor views
- razor view with anonymous type model class. It is possible?
- How to edit multiple models in a single Razor View
- Uploading image in ASP.NET MVC
- How to use multiple form elements in ASP.NET MVC
- ASP.Net MVC: How to display a byte array image from model
- MVC Razor view nested foreach’s model
- Display only date and no time
- Converting ASP.NET MVC Razor @helper function into a method of a helper class
- Visual Studio 2015 Broken Razor Intellisense
- How to elegantly deal with timezones
- Complex models and partial views – model binding issue in ASP.NET MVC 3
- ASP.NET MVC Razor render without encoding
- Multiple fields validation using Remote Validation
- Dictionary map to an object using Automapper
- Client Id for Property (ASP.Net MVC)
- How to get current page URL in MVC 3
- validate a dropdownlist in asp.net mvc
- on select change event – Html.DropDownListFor
- How to represent a month of checkboxes in an MVC model
- Using Razor without MVC [duplicate]
- First html helper generates client-side validation attributes, while the second one doesn’t
- Getting controller name from razor