Replace ImageButton ImageURL with Font Awesome Icon in ASP.Net

Last Reply 19 days ago By dharmendr

Posted 19 days ago

How to make tick mark and cross mark in asp button?

My question is as imqge is binded in image button how to overlay in image button?

<asp:ImageButton ID="img_ss" ImageUrl="../img/ss_logo.png" OnClick="img_ss_Click" runat="server"   class="fa-shopping-cart" ForeColor=""></asp:ImageButton>
<asp:ImageButton ID="img_sa" ImageUrl="../img/sa_logo.png" runat="server" OnClick="img_sa_Click"></asp:ImageButton>
<asp:Button ID="Button1" runat="server" Text="Search" OnClick="Button1_Click" OnClientClick="img_ss_OnClientClick()"  />

When I click the Button1, the img_ss should be in Font awesome check and img_sa should be font awesome remove using code behind coding

You are viewing reply posted by: dharmendr 19 days ago.
Posted 19 days ago

As FontAwesome is a font that requires HTML elements to display, neither asp ImageButton (only allows images) nor asp Button (only allows plain text). It is better to use HtmlButton.

<button runat="server"><i class="fa fa-check"></i></button>