How to Change ActionLink Text Color In ASP.NET MVC

In this article we will learn how to change the default ActionLink color ,The default color of the ActionLink is the blue , Now to change this default color you need to overload ActionLink as shown in below code .
To set white color


@Html.ActionLink("Index", "ActionName", "ControllerName", null, new { id = "OT",style = "color: white" })


To set Red color


@Html.ActionLink("Index", "ActionName", "ControllerName", null, new { id = "OT",style = "color: Red" })

In the above code 

  • Index is the ActionLink Name 
  • ActionName is the View name or ActionResult Name.
  • ControllerName will be name of our controller  .
If you wants to avoid controller name to be pass then instead of controller name just pass null as

without passing controller name

@Html.ActionLink("Index", "ActionName", "ControllerName", null, new { id = "OT",style = "color: Red" })

Summary
I hope this article is useful for all readers. If you have any suggestion then please contact me.




Post a Comment

www.CodeNirvana.in

Protected by Copyscape
Copyright © Compilemode