C
C#2y ago
surwren

Modularity for functions in view

Is it possible for me to package the code to be used in my view into a function, and then call aforementioned function in the view? If you look at my image, the code is messy as all heck because I'm using @ notation to put it directly into a div. I'm looking for a way to clean up the code.
2 Replies
Zendist
Zendist2y ago
Creating and Using a Helper in an ASP.NET Web Pages (Razor) Site
This article describes how to create a helper in an ASP.NET Web Pages (Razor) website. A helper is a reusable component that includes code and markup to perf...
Yawnder
Yawnder2y ago
You can't package a function. Functions reside in classes which are in assemblies. That's what you can package. After that, it can be used like any other class.