I have an ASP.NET MVC3 application. I would like to have a custom toolbar that I want to display in every form. This custom toolbar can have one or many action links.So, I need to develop a Custom Html helper that I can use like below;
@Html.CustomToolBar(items => {
items.Add("Action","Controller","Name","Text");
items.Add("Action1","Controller1","Name1","Text1");})
This custom extension will produce the links html and I will display it on my form. I have a ToolBarAction
class and I would like to get List<ToolBarAction>
from @Html.CustomToolBar
.
public class ToolbarAction
{
public string Name { get; set; }
public string Action { get; set; }
public string Controller { get; set; }
public string Text { get; set; }
}
Can you advise me how I can achieve this? If you could point me the appropriate resources, that would be great really..
Many thanks
Regards..