
Razor function is exactly similar to C#/vb.net methods/Function. These features came asp.net MVC 3.0 onward. Here we can write the frequently used functionality inside the function.
Here I will show how to use in Razor function in view.
We have to give function syntax like this:
- @functions
- {
- // Here will be C# method
- }
Note: I hope you are aware of creating view in asp.net MVC.


zumoPosted Sep 4, 2022, 8:19 AM
I can not call function on submit button and return string to input textbox ?
Nitesh KejriwalPosted Jan 8, 2020, 5:35 AM
Can you combine all functions across the project in a single file and then reference it across view pages?
Gowtham RajamanickamPosted Jul 9, 2015, 12:30 AM
great..