Reputation: 3684
I am trying to add spinner to the button. I searched and I found the simplest way is describe by Flion on this link. I dont know how add the suggested button code to my asp.net button.
Suggested code is
<button class="btn btn-lg btn-warning">
<span class="glyphicon glyphicon-refresh spinning"></span> Loading..</button>
and my code is
<asp:Button ID="LoginButton" runat="server" OnClick="Button1_Click" Text="Login" CssClass="btn btn-primary col-xs-12"/>
Upvotes: 0
Views: 4992
Reputation: 3684
So in asp.net, the simple solution at least for now is
<asp:Button ID="LoginButton" runat="server" OnClick="Button1_Click" Text="Login" CssClass="btn btn-primary col-xs-12" UseSubmitBehavior="false" OnClientClick="this.value='Please wait...';"/>
Upvotes: 1
Reputation: 1571
this may help you
<button id="btn" runat="server" onserverclick="Button1-Click">
<span>Click</span></button>
try using this code if it helps...
Tell me if it helps...
Upvotes: 0
Reputation: 40970
You can use the suggested code as it is. You just need to use the runat="server"
to access that html button at code behind. Apart from this you also need to setup the onclick
event like this
<button class="btn btn-lg btn-warning" runat="server" onclick="Button1_Click" id="LoginButton">
<span class="glyphicon glyphicon-refresh spinning"></span>Loading..
</button>
Upvotes: 3