views:

142

answers:

2

hii,,

I have a mail list where i can select many mails and download (with/without opening the mail). During the download process i update the mail status(download/open) and show the content in pdf. In normal browser dialog opens where user can save open or cancel options exits. But if the user cancel then the update process done on the mail should not happen. so i think about doing the update process if the user clicks open or save but how can i identity that client control (i think it depend on the browser)

The issue is present if i download and unopened mail and click cancel button in the dialog box

the pdf creation code i have done is in this link

http://stackoverflow.com/questions/3385655/how-to-create-pdf-from-html-stored-in-a-string-from-database-using-itextsharp

which i used to open that dialog in browser to save pdf

how can i manage this issue, please suggest efficient method(if possible with code) to handle this issue

+2  A: 

There is no way to tell what the user has done once you've sent them the PDF from the server, whether they save the file or cancel is entirely client-side within the browser and you won't be able to get notified of what happened.

Also note that some people have PDFs set to open and display within the browser automatically so they might not even get a dialog at all.

Paolo
thanks for the valuable answer,, how can i manage this issue...Is only one way present to download only opened mails or can i manage this somehow
deepu
A: 

If I understand the problem correctly, then you would have to introduce an additional step before you present the user with the open/save dialogue.

For example: Provide two buttons [open/save] and [cancel]. The first will proceed to show the dialogue and update the mail, whereas the second will not even show the dialogue. If they click open/save and then cancel the dialogue message then it is not your problem.

You could even provide a list with checkboxes for the user to specify which mails he/she would like. (I don't know enough about your process to know if this is valid, but you get the idea.)

Peet Brits
yes i understand what u said but even i provide a dialog before the present dialog, the same action occurs..but i have to make some possible way to handle it..
deepu