How do I convert the code below to an buttonclick instead of an imageButton string alternateText = (sender as ImageButton).AlternateText;