Could you elaborate? Did not get your questions. Are you trying to move the logic written in the button click event to some other place?