Event fire again and again when use response method for export gridview to excel
<p>hello everybody
i am using c# .net in my webapplication.
i have a method for export gridview data to excel name ExportToExcel().
in this method i use response.contenttype, response.clear(),response.write(),stringwriter,htmltextwriter  methods.
this method work fine and export data correctly.
but when i write 
button1.visible = false above that method call then button does not unvisible. 
Means i write the following</p>

<p>button1.visible = false;    //   both not work on runtime
panel1.visible = false;     //
ExportToExcel()</p>

<p>another problem is that after call ExportToExcel() method if i click on any button on my webpage then ExportToExcel() again call and shows dialog box to save and open excel file.</p>

<p>so please help me how to solve this problem
I m unable to send code due to company rules so please help me</p>

<p>Thank to all in advance</p>
