Click here to Skip to main content
14,879,482 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

How can i enable and disable button in menu items for insert and update :
for example i had insert some record in the database via page now some record is inserted now insert buttton in the menu option gets disabled and edit button gets enabled

1 solution

If you're trying to do this from server side code, it's as simple as calling
// Disable the insert button.
InsertButton.Enabled = false;
Now if you're trying to do this from JavaScript, you'd want to do something like this (assuming you're using jQuery)
// Disable the insert button
<%= InsertButton.ClientID %>.attr('disabled','disabled');
// Enable it
<%= InsertButton.ClientID %>.removeAttr('disabled');

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900