-2

I currently designing on a website where the developer uses (asp:Button)'s to add a product to the "cart" and another asp:Button to add the product to the wish list. The developer has the button code like this:

<asp:Button ID="AddToBasketButton" runat="server" Visible="true" OnClick="AddToBasketButton_Click" Text="+ Add to Quote" EnableViewState="false" ValidationGroup="AddToBasket"></asp:Button>

From this little snippet you can see that the button will ultimately say "+ Add to Quote"

I am looking for a way to implement html in the Text=""

For example if I wanted to put

Text="<p>+ Add to Quote</p>"

In the real life scenario I am trying to add a Glyphicon to replace the "+" sign so I was trying to add a <span class="glyphicon"></span> before the Add to Quote button.

Is there another attribute I could be using to accomplish this without having to remap the backend function that "adds" the product to the quote list?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

0

This option hasn't html in text attribute, but you can do by this way:

<asp:Button ID="AddToBasketButton" runat="server" Visible="true" OnClick="AddToBasketButton_Click" EnableViewState="false" ValidationGroup="AddToBasket" CssClass="btn btn-primary">

    <span aria-hidden="true" class="glyphicon glyphicon-plus"></span> Add to Quote

</asp:Button>
Dani
  • 1,825
  • 2
  • 15
  • 29