Unable to close modal dialog in Ax2012 EP

Hi

I have a requirement in EP where on clicking of a action menu item button i should get a prompt to

proceed or not. If it is allowed to proceed then some operation should get executed and should be

redirected to a “download document” url which opens a document

For this i tried to use AxModal prompts but these are not working in the methods where there is

“ActionMenuItemEventArgs” argument.
So i have created a new web page (modal dialog) with a web control having Yes/No buttons
On clicking of Yes button, i have executed my code which also redirects to “download document” url

which opens a document. But i am unable to close this new web page (modal dialog) automatically.
But the code is getting executed and opening the document
I have used DialogHelper.close() but this is not working

Does any one have idea what might be the problem and how to close the modal dialog ?

Note: I have used DialogHelper.Navigate() and also tried response.redirect() for redirecting to download url.