Font awesome inside asp button

You can’t with the default asp.net button you will need to use a HTML button and give it runat=server attribute:

<button runat="server" id="btnRun" class="btn btn-mini" title="Search">
    <i class="icon-camera-retro"></i> Search
</button>

So use code behind with this you add:

onserverclick="functionName" 

To the button, then in your C# do:

protected void functionName(object sender, EventArgs e)
{
    Response.Write("Hello World!!!");
}

So final button looks like:

<button runat="server" id="btnRun" onserverclick="functionName" class="btn btn-mini" title="Search">
    <i class="icon-camera-retro"></i> Search
</button>

Leave a Comment