I tried to disable an asp.net button but failed.
The error:
Compiler Error Message: CS1501: No overload for method 'btnUnlock_Click' takes '0' arguments
Source Error:
Line 99: <asp:Button ID="btnUnlock" runat="server" Text="Unlock User" Visible="False" OnClick ="btnUnlock_Click()" />
And
protected void btnUnlock_Click(object sender, EventArgs e)
{
MembershipUser user = Membership.GetUser(userName);
user.UnlockUser();
}
Thanks.
Use
OnClientClick="return false;"to disabled postback. You can try thisIn C# you can disable button by
IsEnabled Property MSDN link