Issue:
To download file from Sharepoint doesn’t work but works fine in plain asp.net environment.
Solution:
Solution is very simple, Add the following code for the button or link which initiates the download:
MyButton.OnClientClick = "document.getElementById(""" & Me.Page.Form.ClientID & """).onsubmit = function() {return true;}"