asp.net mvc 3 - How to display dynamic Html.ActionLink label? -


this code works, displays "details" every row of table:

    @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 try change line format: (item) => html.actionlink(item.code, gives me error. how come? item of class has code property, visible in other parts - returns routing values fine... needs done display hyperlink text dynamically? oh, i'm on mvc 3.

try this. displaytext dynamic value.

`columns: appsgrid.columns(           appsgrid.column(columnname: "code",                   header: "",                   format: (item) => html.actionlink((string)item.displaytext,                                      "index",                                    "applicationtechstack",                                    new {code = item.code},                                    null), 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -