I have a VB.NET form that contains textboxes for the user to enter his details. I have a delete button in the same form that I want only the administrator or any authorized person to be able to use.
Basically, I want to make the delete button password protected so that the normal user can’t delete any of his details. only the admin who has the admin password can delete it.
Is it possible to create a password protected button? I searched on the Internet but couldn’t find any links that would help me.
Thanks
From a usability perspective I’d suggest a ‘better’ way to implement it would be to use some sort of role-based model, whereby the user authenticates when they begin using the app and role-specific form elements are then displayed accordingly.
If you really want a password to be entered to use a button, why not leave it enabled and in the click event handler, show a password-capture form? You only execute the rest of the code if the password is correct, else the event gets cancelled.