views:

58

answers:

3

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.

+1  A: 

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.

Darin Dimitrov
@Darin - what do you think about a screen scrape? Could it be accomplished in the code behind using some sort of screen scraper?
swolff1978
At the server side you could perform a request to your site and try to do screen scraping but this definitely won't be the same request that caused an error at your client's computer. It might event not cause an error at all.
Darin Dimitrov
A: 

instead of such screen shot, using Server.GetLastError() to capture the error and sending to admins has more meaning

Henry Gao
we are currently gathering this information, we were just trying to figure out a way to get a screen shot as well.
swolff1978
A: 

Not much of a .NET guy but, there should be some way to get the Response object in your exception catching code and then include a serialized representation of it in your email. Things like headers and session variables are also useful, FWIW...

AJ