I have a customized HTML5 button that serves as both a SAVE and CREATE option, with the text changing dynamically based on conditions set in the code behind. Everything is running smoothly so far, however, I am facing an issue when attempting to include an icon style element to my button using the code behind:
<button typeof="button" id="btnSaveCreate" class="btn btn-danger" runat="server" onserverclick="btnSaveCreate_ServerClick"><i class="fas fa-road"></i></button>
I have been experimenting with altering the text and adding a Font Awesome icon through the code behind like this:
btnSaveCreate.InnerText = "Save <i class=\"fas fa-road\"></i>";
Unfortunately, the above method doesn't seem to work, and neither does this alternative approach:
btnSaveCreate.InnerText = "Save";
btnSaveCreate.Attributes.Add("class", "fas fa-road");