views:

185

answers:

3

Hello all,

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

<%=Html.ActionLink("Forgot password?", "ForgotPassword")%>

Thanks ritz

A: 

You supply HTML attributes as anonymous objects:

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

You should use:

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

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;
}
ILMV