boutique replica bags up ideas

the best replique rolex and prices here.

julia highlight 99j hair color 10a quality straight human hair lace front wigs 8 - 24 inches pre plucked hairline 13x4 inches lace front brazilian wig onlinefor sale

ASP.NET MVC: Create and Call External HTML helper method in Razor markup

Updated on     Kisan Patel

Create a C# class in any new folder (in this case “Utility”) of the application and write following code.

NAMESPACE:

using System.Web.Mvc;

CODE:

public static class CustomHelpers
{
   public static MvcHtmlString Sum(this HtmlHelper html, int a, int b)
   {
         return new MvcHtmlString((a + b).ToString());
   }
}

Note the first parameter of the Sum method ie. HtmlHelper that help us to call this method using @Html.

This creates an extension method called Sum that can be used in Razor syntax using @Html.

<li>External Helper Method Output: <strong>@Html.Sum(15, 5000)</strong> </li>

Fore Detailed Example and Source Code Go to: Create Custom HTML Helper methods in ASP.NET MVC


ASP.NET MVC

Leave a Reply