Search code examples
c#.net.net-3.5screen-scrapingscreenshot

How do I capture a web applications screen to attach to an e-mail on error?


I am working on a web application and we would like to capture the screen (either the applications current screen or the whole screen) and attach this to an e-mail that is automatically generated for error messages. I've seen a few posts about how to do this in a winform app, but nothing really on how to do it in a web app. Is it the same process? Any sites that have helpful steps on how to achieve this in a web app are appreciated.

EDIT: Is it possible for us to achieve something similar with screen scraping? I'm not too familiar with what all can be done with a screen scrape so any suggestions are also welcomed.


Solution

  • There's no screen in a web application. You have to do this on the client machine, who has a browser capable of transforming the HTML to some interface worth capturing.

    What you could do in your web application is to register for the Application_Error event in global.asax and send an email for each exception.