ASPX:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="btSave" runat="server" OnClick="btSave_Click" Text="Save Data" />
<br />
<asp:UpdateProgress ID="UpdateProgress1" runat="server"
AssociatedUpdatePanelID="UpdatePanel1"
DisplayAfter="100" DynamicLayout="true">
<ProgressTemplate>
<img border="0" src="loader.gif" />
</ProgressTemplate>
</asp:UpdateProgress>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btSave" />
</Triggers>
</asp:UpdatePanel>
ASPX.CS
protected void btSave_Click(object sender, EventArgs e)
{
// Some Calculations
btSave.Enabled = false;
System.Threading.Thread.Sleep(900);
btSave.Enabled = true;
Response.Clear();
Response.ContentType = "text/plain";
Response.AppendHeader("content-disposition", "attachment;filename=data.txt");
Response.WriteFile("data.txt");
Response.End();
}