Ritz
Ritz

Reputation: 97

how to give css to action link?

Below is my action link . How shall I apply css to the following? Actually i want to give the class as we do in asp.net simple application. Please tell me what shall I do?

Upvotes: 1

Views: 1151

Answers (3)

Ben Everard
Ben Everard

Reputation: 13804

I'm not a .net developer, but replace your ActionLink code with this:

<%=Html.ActionLink("Forgot password?", "ForgotPassword", new { @class="my_class" })%>

And add this to your CSS:

.my_class {
    color: #fff;
}

Upvotes: 3

Richard
Richard

Reputation: 22016

You should use:

<%=Html.ActionLink("Forgot password?", "ForgotPassword", new{ @class="classname" }) %>

Upvotes: 1

Paddy
Paddy

Reputation: 33857

You supply HTML attributes as anonymous objects:

<%=Html.ActionLink("Forgot password?", "ForgotPassword", new{ @class="MyCSSClass" })%>

Upvotes: 1

Related Questions