Reputation: 3739
Am trying to change text of an asp:Button using jQuery Like this
$("#<%=delButton.ClientID%>").attr('text', 'InActivate');
.....
<asp:Button ID="delButton" runat="server" UseSubmitBehavior="false" Text="Activate "
CssClass="button" ToolTip="" OnClientClick="ondel();return false;"/>
I can see the text changing, Is the proper way to do?
Thanks
Upvotes: 4
Views: 11658
Reputation: 238068
Yes, that's the best way I know of. This will get you the right client id regardless of clientIDMode:
<%= delButton.ClientID %>
Upvotes: 1
Reputation: 5553
This is shorter ;)
$("#<%=delButton.ClientID%>").val('InActivate');
Upvotes: 9