Posted By : Murugan Andezuthu Dharmaratnam
Posted On :
Keywords :

Best Practice To Manage Your Scripts Using Razor Helper

The Easiest Way to add files to your source code is to drag and drop the files to your code from the solution explorer. You can make the Script More Managable by using a Razor Helpers.

Step 1 : Start A New Project Named It RazorHelper.

Step 2 : Open Resister.cstml View And Follow the steps below

No You are not done yet. Lets make the helper global so that we dont have to add the helper code to every page. To Do this

Step 1 : On The Project Create a New Director App_Code
Step 2 : To App_Code Directory Add a New Razor View Page Name It Content.cshtml
Step 3 : Paste The Helper , Here You can see the Code Modifications

Step 4 : Call The Helper In Register

!-- image link -->