tags:

views:

45

answers:

1

Im using an action link and passing in tRVD where tRVD is the following:

<% RouteValueDictionary   tRVD = new RouteValueDictionary(ViewContext.RouteData.Values); %>

heres my link.

<%= Html.ActionLink("Previous", "Index", tRVD)%>

how do i add a class attribute to this href?

i tried this:

<%= Html.ActionLink("Previous", "Index", tRVD, new { @class = "left" })%>

but it breaks the tRVD...

A: 

You´re using an incorrect overload of the ActionLink method. Why don´t you try with

<%= Html.ActionLink("Previous", "Index", tRVD, new Dictionary<string, object> { { "class", "left" } })%>

Regards.

uvita