This is my asp:button code which is not rendering font awesome's icon but instead shows the HTML as it is:
<asp:Button runat="server" ID="btnRun" Text="<i class='icon-camera-retro'></i> Search" ValidationGroup="edt" OnClick="btnRun_Click" CssClass="greenButton"/>
Any idea how can I solve this issue?
Get it on Nuget!
Install-Package FontAwesome-ASP.NET Usage
FontAwesome Icons In Webforms Buttons
You can use FontAwesome icons inside asp.net webforms button controls. Simply databind to the icon of your choice from the FontAwesome.Icons class' static properties. Then either call DataBind() on your button or DataBind() on your parent control or page.
You can also try this solution -
Use LinkButton
In the others answers changes asp:button by other one, I show you if you want use asp:button, EASY :)
You can use a LinkButton
They do support html in the text field.
You can do it, jut not purely with CSS. You just need to set the Text property on the button to the unicode value of the fontawesome character and give the button the 'fa' css class so it takes up the fontawesome font.
I made this helper library that provides all the icon codes strongly-typed if that turns your crank:
Nuget: Install-Package FontAwesome-ASP.NET
Source: https://github.com/kemmis/FontAwesome-ASP.NET