Click here to Skip to main content
15,920,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

HTML
@appsGrid.GetHtml(
   tableStyle: "table",
   headerStyle: "head",
   alternatingRowStyle: "alt",
            columns: appsGrid.Columns(
                appsGrid.Column(columnName: "Code",
                                header: "",
                                         format: (item) => Html.ActionLink("Details",
                                                                  "Index",
                                                                  "ApplicationTechStack",
                                                                  new {Code = item.Code},
                                                                  null
                                                                 ),




However, when I try to change the line to format: (item) => Html.ActionLink(item.Code, it gives me error. How come? item is of class that has Code property, as visible in other parts - returns routing values just fine... What needs to be done to display the hyperlink text dynamically? Oh, I'm on MVC 3.
Posted
Updated 16-Oct-11 19:34pm
v2

1 solution

<a href="http://stackoverflow.com/questions/4570193/razor-mvc-3-rc2-webgrid-actionlink-with-dynamic-text">http://stackoverflow.com/questions/4570193/razor-mvc-3-rc2-webgrid-actionlink-with-dynamic-text</a>[<a href="http://stackoverflow.com/questions/4570193/razor-mvc-3-rc2-webgrid-actionlink-with-dynamic-text" target="_blank" title="New Window">^</a>]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900