Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello gents,

In an asp.net project I have a table to set parameters for a report.
After clicking button Generate the linkbutton Export to Excel will show up if the reports have records.
Generate will fill a GridView and that is showing fine.
linkbutton uses PostBackUrl to an ashx file.
In the ashx handler I retrieve the parameters and with ClosedXML an ExcelFile is created and can Chrome shows the download at the bottom of the browser.

Funny part now is that when I change my parameters and press Generate again, the ashx handler gets called.

How to overcome this?

What I have tried:

Read a lot on google about this issue. Even generating clientside of the excel calling the ashx over $.ajax does not work me.

How do I have the button event restored?
Posted
Updated 10-Dec-21 4:07am

1 solution

Don't use asp:LinkButton but use asp:Hyperlink. That is solving this issue
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900