Listing 10 Customized security checking
// You could disable (or hide) the button competely private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here if ( !MayEdit ) btnUpdate.Enabled = false; } // Or check for edit permissions when the button is clicked private void btnUpdate_Click(object sender, System.EventArgs e) { if ( MayEdit ) { //save changes } else Label1.Text = "Sorry, you do not have permission to change salaries."; }