I'm using Twitter Bootstrap, and trying to make my links ASP.Net MVC look nice.
However, the <i class=... in the link below, is html encoded, rather than being sent as html to the browser:
@Html.ActionLink("<i class='icon-user icon-white'></i> Create New", "Create", "", New With {Key .class="btn btn-primary"} )
Is there any way of keeping the <i class=... as html, so that the button displays correctly?
The Html.ActionLink creates an anchor element based on parameters supplied. In this example, we will learn how to use Asp .Net MVC Html.ActionLink. We will also create multiple types of Action links like: HtmlActionLink without controller name. HtmlActionLink with controller name. HtmlActionLink with parameters. HtmlActionLink with Area.
What is twitter bootstrap. Twitter Bootstrap is a front end framework to develop web apps and sites fast. In modern web development, there are several components which are required in almost all web projects. Bootstrap provides you with all those basic modules - Grid, Typography, Tables, Forms, Buttons, and Responsiveness.
Bootstrap provides you with all those basic modules - Grid, Typography, Tables, Forms, Buttons, and Responsiveness. Besides, there are a plethora of other useful front-end components like Dropdowns, Navigation, Modals, Typehead, Pagination, Carousal, Breadcrumb, Tab, Thumbnails, Headers etc.
The Bootstrap Tooltip gives us a hint about the specific element in a graphical manner. Tooltip is used for performance reasons so it can be customized as per the requirement domain. Tooltip is implemented using javascript, it relies on a 3rd party library known as popper.js for positioning purposes.
Instead of using @Html.ActionLink()
, just write out the <a>
tag yourself. You can use @Url.Action()
to get the URL of an action for your HREF attribute.
The @Html
helpers are nice, but they won't always provide the flexibility you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With