-2

when i am using fa fa-inr for displaying rupees icon

<div class="inner-addon left-addon editor-field">
     <i class="fa fa-inr"></i>
     @Html.TextBoxFor(model => model.Price,new { @class = "form-control"})
     @Html.ValidationMessageFor(model => model.Price)
</div>

it not works properlyfor fontawesome icon - rupee

it works when i am using glyphicon icons.

<div class="inner-addon left-addon editor-field">
     <i class="glyphicon glyphicon-euro"></i>
     @Html.TextBoxFor(model => model.Price,new { @class = "form-control"})
     @Html.ValidationMessageFor(model => model.Price)
</div>

it works properlyfor glyphicon icon - euro

manish jadhav
  • 15
  • 2
  • 10

2 Answers2

0

See this post: font-awesome not working bundleconfig in MVC5

Looks like your font-awesome css is not properly referenced. Also, looks like you are using HTML Helpers through razor and maybe bootstrap.

The best choice for ASP.NET MVC is to bundle it so you may need to use the following format with .Include inside your Bundle.config:

 bundles.Add(new StyleBundle("~/Content/css").Include(
            "~/Content/Foo.css",                        
            "~/Content/Bar.css",
            "~/Content/Boo.css",
            "~/Content/Far.css"
        ).Include("~/yourpath/font-awesome.css", new CssRewriteUrlTransform());

Maybe update your NuGet package and then recheck that your reference is correct.

If all else fails, an easy fix is to put this CDN link in your <head></head> :

<link rel="stylesheet" href="https://opensource.keycdn.com/fontawesome/4.7.0/font-awesome.min.css" integrity="sha384-dNpIIXE8U05kAbPhy3G1cz+yZmTzA6CY8Vg/u2L9xRnHjJiAK76m2BIEaSEV+/aU" crossorigin="anonymous">

if you use the CDN link, make sure you're not also referencing a font-awesome.css file in your project. Check Bundle.config and make sure to delete the reference.

http://ericpanorel.net/2013/10/25/font-awesome-4-0-mvc-bundling-and-minification/

Community
  • 1
  • 1
smurtagh
  • 1,187
  • 9
  • 17
0

I gave reference of fontawesome-all.min.css instead of fontawesome.min.css and it worked.

Himalaya Garg
  • 1,525
  • 18
  • 23