ryan1107 Posted November 16, 2006 Posted November 16, 2006 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 doesn't do anything. How would you recommend solving this problem? Even if I can get the eventhandler to work on the other tpages, I don't 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! Quote
Administrators PlausiblyDamp Posted November 17, 2006 Administrators Posted November 17, 2006 If the control raises an event you would only need to handle it in the one page that needs to check for changes - the other 3 pages wouldn't need to have an event handler for the control and no code would be run Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.