Creating Methods with Parameter in Razor Syntax

In this chapter you will learn

  • How to create methods with parameter in razor syntax?
  • Programming Example

How to create methods with parameter in razor syntax?

You can simply create methods in razor syntax using @functions keyword. See the following example for better demonstration.

Programming Example


  • Output

    Add of 5 + 6 is 11
    Add of 9 + 10 is 19

    Summary

    In this chapter you learned to declare or define methods with parameter in razor syntax. In the next chapter you will learn to handle exceptions and errors in razor syntax.


    Leave a Reply

    Your email address will not be published. Required fields are marked *