Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
How to Create Razor Function in Asp.Net MVC View?
WhatsApp
Chandradev Sah
10y
103.5
k
0
1
25
Blog
See given below image:
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
}
For calling the function Just give
@MethodName
Note:
I hope you are aware of creating view in asp.net MVC.
Up Next
ASP.NET MVC 5 Create Shared Razor Layout And ViewStart
Ebook Download
View all
ASP.NET MVC 5: A Beginner’s Guide
Read by 28.1k people
Download Now!
Learn
View all
Membership not found