Action link @class="info"
not working for css
@Html.ActionLink("Click Here", "Details", "Product", new { id = item.ProductId, @class="info" },null)
Html page source
<a href="/Product/Details/14?class=info">Click Here</a>
on the other hand
if i set @Html.ActionLink("link here", "Details", "Product", new { id = item.ProductId})
then generate this link localhost:18715/Home/Details?Length=7
why? and it is not working
if i set @Html.ActionLink("link here", "Details", "Product", new { id = item.ProductId},null)
it is working perfectly generate this link http://localhost:18715/Product/Details/17
what i am missing for each link
You have to write hmtl attributes like this:
@Html.ActionLink("Click Here", "Details", "Product", new { id = item.ProductId }, new { @class = "info"})