I am trying to create an extension method in C # for the HtmlHelper class. I read the MSDN page for it, and I am sure that I am referencing the correct namespaces. I wonder what I can do wrong.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace MvcApplication1.HelperMethods
{
public static class NavigationalMenu
{
public static string MyMenu(this HtmlHelper helper)
{
CategoryRepository categoryRepo = new CategoryRepository();
var categories = categoryRepo.FindAllCategories();
foreach (Category c in categories)
{
helper.RouteLink(blablabla);
}
}
}
}
The first time this happens to me when programming in C #. Anyone else run into this problem?
delete
source
share