I'm outputting an Actionlink, in a WebGrid, with Dynamic link text and the only way I can get it to work is as follows:
Grid.Column(header: "Subject", columnName: "Message.Subject", format:(item) => Html.ActionLink(((object)item.Message.Subject).ToString(), "Message", new {Id = 12345 }))
Does anyone have a better way of doing this?
Not much different.
Grid.Column(
header: "Subject",
columnName: "Message.Subject",
format: (item) => Html.ActionLink(
(string)item.Message.Subject, "Message", new { Id = 12345 }
)
)
See: How to make a MVC 3 Webgrid with checkbox column?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With