Html.ActionLink in Html.TreeView?
Hi,
Im using the HTML.TreeView to render my code structure like this :
<%= Html.TreeView("CategoryTree",
Model.CategoryList,
l => l.ChildList,
l => l.Name + " / <a id=\"treeLnk" + l.Id + "\" href=\"JavaScript: OpenAddDialog('" + l.Name + "', " + l.Id + ") \" title=\"Lägg till\" >Lägg till</a>" +
" / <a id=\"treeLnk" + l.Id + "\" href=\"JavaScript: OpenChangeNameDialog('" + l.Name + "', " + l.Id + ") \" title=\"Ändra namn\" >Ändra namn</a>" +
" / <a id=\"treeLnk" + l.Id + "\" href=\"JavaScript: OpenDeleteDialog('" + l.Name + "', " + l.Id + ") \" title=\"Tabort\" >Tabo开发者_Python百科rt</a>") %>
This work fine, but now I need to include a action that redirects to another controller\action.
I have tried to ad a Html.ActionLink but this does not work?
You could have specified which TreeView helper are you using because there's no such thing built-in ASP.NET MVC but try like this:
<%= Html.TreeView("CategoryTree",
Model.CategoryList,
l => l.ChildList,
l => l.Name + Html.ActionLink("Link Text", "action", "controller").ToHtmlString())
%>
精彩评论