Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I put a <span> tag in the Text property of an ASP:Button?

Tags:

c#

asp.net

I am trying to do something like this:

<asp:Button ID="btnSearch" 
            runat="server" 
            CssClass="greybtn" 
            Text='<span>Search</span>'
            OnClick="btnSearch_Click" />

It displays <span>Search</span> instead of just Search.

like image 449
Xaisoft Avatar asked Mar 04 '09 16:03

Xaisoft


1 Answers

You can put a span on an ASP.NET LinkButton like this:-

<asp:LinkButton ID="TestLinkButton" CssClass="btn btn-success" runat="server"><span class="glyphicon glyphicon-refresh"/>Press Me</asp:LinkButton>
like image 88
Philip Johnson Avatar answered Oct 06 '22 00:10

Philip Johnson