i am new in MVC and trying to write a sample html helper like this way here is my html helper code.
namespace MvcPractise.Extension
{
public static class LabelHelper
{
public static string Label(this HtmlHelper helper, string target, string text)
{
return String.Format("<label for='{0}'>{1}</label>", target, text);
}
}
}
i use it as follows in my view like
@using MvcPractise.Extension.LabelHelper
@model MvcPractise.Models.EmployeeModel
at the top of the view i declare or refere the namespace and class name like above
and use it like @Html.Label("firstName", "First Name:")
but when i debug the code the my extension method is not getting hit. i could understand that i am doing something wrong but could not figure out. so please help. thanks
@Html.Label("firstName", "First Name:")but your method isMLabelintellisense?