I have a
<asp:Button runat="server" Text="Something" ID="btnFoo" OnClick="OnFoo" />
In the OnFoo event handler, I want to make a normal postback on the server (update database and rerender the UI) and at the same time I want to download a PDF file. There are problems when I send it like a Response (with headers, flushed etc.), because after it the page does not behave normally anymore.
So I thought myself (because I have never do that), that I could make a proxy button
, where the javascript OnClick could click on both - the btnFoo
and the <a href="download.aspx?p=123" target='_blank' />
. (or window.open). In the download.aspx would be the file downloaded.
What do you think about it and what do you recommend, please?