I am trying to use the new WebGrid in ASP.NET MVC3 and one of the columns I want to display set of link icons that performs various actions (Edit, View, Delete)... For this
I had to create a WebGrid
in C# code and had to display a specific column using hyperlink. None of the techniques mentioned above worked for me. So, I used MvcHtmlString.create
and passed in the return value of String.format
to it.
format: (item) => MvcHtmlString.Create(string.Format((A HREF=\"/Inventory/EditInventory/{0}\"){1}(/A)", item.ID, item.Property)))
Replace the ( or ) inside the string with < or > respectively.