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\" >Tabort</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())
%>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.