I have a 5 page aspx "master". they each contain a "SaveAndExit" button that performs a C # function in a shared static class. After saving, the C # code is redirected to another page.
You cannot do it exactly the way you want it.
But I think it's probably best to do nothing. It looks like if the failure fails, you won't be redirecting. You will probably even see some kind of error. If your user doesn't have enough confidence in your application that they don't trust him even when there is no error message and he went to the next step, you're in trouble.
source to share
Vic, if this isn't homework, I'd really like you not to.
If you insist on showing the message when you save it, consider adding perhaps a session variable, and on the redirected page display the "Data saved" message at the top if the session variable exists, then remove the session variable.
Again, as Joel Coehorn said, you should definitely show a message if there is an error, but the redirect should be all the "proof" they need in order for their data to be saved.