How to create Razor function in MVC View?


Razor function is exactly similar to C#/ methods/Function. These features came 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

// Here will be C# method

For calling the function Just give @MethodName


Note: I hope you are aware of creating view in MVC.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.