I have an HTML Action Link as
<div>@Html.ActionLink("New Requests>", "GetNewRequests", "Resource", null, new { @class = "spbutton" })</div>
Which displays on a page as a link “New Requests >” when clicked it shows a grid of the requests.
I now need this link to be “New Requests (x)>” ex( New Requests(4)) where x is the count of the number of new requests, also equal to the number of rows in a grid.
I am not sure how to dynamically add the text the Html.ActionLink call.
Any help appreciated.
Add a property to your view model containing this information. Have the controller action populate it. And then it’s trivial: