2
猫我在@helper函数上创建一个委托?razor @helper返回什么类型?
@helper DisplayCategoryTree(int? parentId)
{
Func<Category, CategoryNode, MvcHtmlString> act = new Func<Category, CategoryNode, MvcHtmlString>(GetChildItem);
act(Category, CategoryNode);
}
@helper GetChildItem(Category, CategoryNode)
{
}
我想补充一点,我写了深入的文章关于HTML助手,将教你几乎一切关于他们。 http://www.simple-talk.com/dotnet/asp.net/writing-custom-html-helpers-for-asp.net-mvc/ –