ConfirmMessage and File Downloads

I have the following gin the Open event of the session:

me.ConfirmMessage="Snarky Message about leaving the page"

But I also use the following in a button;

Dim f As Folderitem = //some fil If f <> Nil And f.Exists Then Session.FileToDowload = WebFile.Open(f) Session.FileToDowload.ForceDownload = True ShowURL(Session.FileToDowload.URL) End If

Unfortunately the user never leaves the page, but they get the message.

So I tried:

Session.ConfirmMessage="" If f <> Nil And f.Exists Then Session.FileToDowload = WebFile.Open(f) Session.FileToDowload.ForceDownload = True ShowURL(Session.FileToDowload.URL) End If Session.ConfirmMessage="Snarky Message about leaving the page"

But it seems I have a timing issue with turning off the ConfirmMessage.

Question 1: Can you infect turn of the ConfirmMessage by setting it in “”?
Question 2: How can I temporarily suspend it?

My guess is that you are setting the ConfirmMessage to “”, then to “Snarky Message about leaving the page”, both in the same Method, but your code is evaluated ones you leave the Method, so it’s like the Confirm Message is not emptied here.

Perhaps what you can do is to set the ConfirmMessage to “”, then run the download. In the WebFile.Downloaded event , set the ConfirmMessage back and see what happens.