Wednesday, May 23, 2012

How can I pass an int value as the LinkText for and ActionLink

@Html.ActionLink((string)item.NUM, "Building", "Property", new {id=item.STRAP, bldNum = item.NUM }, null)


This throws a Yellow screen of death.




Cannot convert type 'int' to 'string'




However, this works.



@Html.ActionLink("HI", "Building", "Property", new {id=item.STRAP, bldNum = item.NUM }, null)




No comments:

Post a Comment