Can a user control capture the Page.Error event of it’s parent page and log that exception?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do it, but it is not the best solution it only works if the error occurs after the event has been registered, which means after the control loads, since the page loads first it won’t catch any errors in the page load. A better solution would be to use the Application_Error event in the global.asax.
Put this code in your control: