I am working on an asp.net project that has a usercontrol that is being used for the page heading. There are three buttons for navigation.
There are four aspx pages that use the usercontrol.
On one of the pages, I need to check to see if changes have been made when any of the buttons are clicked and ask the user if they want to save changes.
- I got this to work by adding an eventhandler to the page and doing a raiseevent when a button is clicked.
The other pages do not need to check for changes when the buttons are clicked.
- I have tried adding an eventhandler and doing a raiseevent when a button is clicked, but it doesnt do anything.
How would you recommend solving this problem? Even if I can get the eventhandler to work on the other tpages, I dont like having to duplicate routines in each of the pages.
I could also move the buttons out of the usercontrol and have them on each page, but this also creates duplicate code.
Recommendations?
Thanks!
There are four aspx pages that use the usercontrol.
On one of the pages, I need to check to see if changes have been made when any of the buttons are clicked and ask the user if they want to save changes.
- I got this to work by adding an eventhandler to the page and doing a raiseevent when a button is clicked.
The other pages do not need to check for changes when the buttons are clicked.
- I have tried adding an eventhandler and doing a raiseevent when a button is clicked, but it doesnt do anything.
How would you recommend solving this problem? Even if I can get the eventhandler to work on the other tpages, I dont like having to duplicate routines in each of the pages.
I could also move the buttons out of the usercontrol and have them on each page, but this also creates duplicate code.
Recommendations?
Thanks!