Views: 109K
Replies: 1
Archived
|
Html.ActionLink and class attributeHow do I set the class attribute in Html.ActionLink. When I include for htmlAttributes: new { class = "border" } I get a compiler error.
This is the full line: <% = Html.ActionLink("TextLink", "Action", "Controller", new { class = "border" } ) %> Deshaun Hyram, Feb 19, 2010
|
|
Reply 1Hi Deshaun Hyram! But You cann't use the word "class" because this is reserved keyword . You can try the variant below. For correct use you should be putting symbol "@" before the keyword "class".
<% = Html.ActionLink("TextLink", "Action", "Controller", new { @class = "border" } ) %> Andrey Lesch, Feb 23, 2010
|