开发者

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 + "&nbsp;/&nbsp;<a id=\"treeLnk" + l.Id + "\" href=\"JavaScript: OpenAddDialog('" + l.Name + "', " + l.Id + ") \" title=\"Lägg till\" >Lägg till</a>" +
                          "&nbsp;/&nbsp;<a id=\"treeLnk" + l.Id + "\" href=\"JavaScript: OpenChangeNameDialog('" + l.Name + "', " + l.Id + ") \" title=\"Ändra namn\" >Ändra namn</a>" +
                          "&nbsp;/&nbsp;<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()) 
%>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜