4
我有一个ASP.NET MVC3应用程序。我想有一个自定义工具栏,我想在每种形式中显示。这个自定义工具栏可以有一个或多个操作链接。因此,我需要开发一个自定义Html帮助程序,我可以在下面使用它;在Asp.net中的自定义帮助mvc3
@Html.CustomToolBar(items => {
items.Add("Action","Controller","Name","Text");
items.Add("Action1","Controller1","Name1","Text1");})
此自定义扩展将产生链接html,我会将其显示在我的表单上。我有一个ToolBarAction
班,我想从@Html.CustomToolBar
得到List<ToolBarAction>
。
public class ToolbarAction
{
public string Name { get; set; }
public string Action { get; set; }
public string Controller { get; set; }
public string Text { get; set; }
}
你能告诉我怎么做到这一点吗?如果你可以点我相应的资源,那将是巨大真的..
非常感谢
问候..
非常感谢莫滕! – AnarchistGeek
如何使用Menu函数来生成工具栏....没有共享代码:( – Thomas
它与问题中的代码相同,除了我命名方法'Menu'而不是'CustomToolBar'。 –