Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How to create an actionlink with a twitter bootstrap icon?


Asked by Mohamed Logan on Dec 13, 2021 Bootstrap



To use these, you can simply use this markup <i class="icon-fire"></i> to get a nice fire icon. Translating this into an ActionLink styled as a button in an MVC4 application would look something like the following: Unfortunately, this renders as follows:
Accordingly,
Basic & advanced usage - Material Design for Bootstrap Bootstrap's icon button is a combination of a standard Bootstrap button with Font Awesome icon inside it. It may contain an icon only or text with an icon. Since icons are generally used to deal with the intuitiveness of UI design, Bootstrap icon buttons tend to increase it.
Indeed, Here is Project view after adding all View related to Action Method in MainController. Now on Index view, let’s add Hyperlink. To add Hyperlink, we need to begin with @html helper with following Action Link, then we need to provide linkText to display and ActionName. Following is the snapshot while creating an Action link.
Subsequently,
Using Icons in Bootstrap 4. The new Bootstrap 4 version doesn't include an icon library by default, unlike the previous Bootstrap 3 version that includes Glyphicons in the font format in its core. However, you can still include icons in your project using several external font based icon library.
Next,
The reason this is not rendered correctly is because Html.ActionLink HtmlEncodes the text you pass in the actionLink parameter. You can check this by opening the System.Web.Mvc assembly in your disassembler of choice, and having a look at the GenerateLinkInternal method on the HtmlHelper class.