Hi,
After downloading file the loading screen it does not close ASP.NET C#
I have add a Button in GridView
Thanks in advance for any help
<asp:ScriptManager runat="server" />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="Name" />
<asp:TemplateField HeaderText="" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:HiddenField ID="hfCountry" runat="server" Value='<%# Eval("Country") %>' />
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<div class="modal">
<div class="center">
<img alt="" src="progress.gif" />
</div>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Link" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:Button ID="Link" runat="server" Text="Download" OnClick="OnDownload" CssClass="buttonLink" />
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<style type="text/css">
body {
margin: 0;
padding: 0;
font-family: Arial;
}
.modal {
position: fixed;
left: 0;
z-index: 999;
height: 100%;
width: 100%;
top: 0;
background-color: Black;
filter: alpha(opacity=60);
opacity: 0.6;
-moz-opacity: 0.8;
}
.center {
z-index: 1000;
margin: 30px auto;
padding: 10px;
width: 130px;
background-color: White;
border-radius: 10px;
filter: alpha(opacity=100);
opacity: 1;
-moz-opacity: 1;
}
.center img {
height: 128px;
width: 128px;
}
.buttonLink {
background: none !important;
border: none;
padding: 0 !important;
font-family: arial, sans-serif;
color: #069;
text-decoration: underline;
cursor: pointer;
}
</style>
On the OnDownload I set that will navigate to the next form in the website for export xls file
protected void OnDownload(object sender, EventArgs e)
{
Button btn = (Button)sender;
GridViewRow row = btn.NamingContainer as GridViewRow;
string ese = (row.FindControl("hfCountry") as HiddenField).Value;
if (!string.IsNullOrEmpty(ddl.SelectedValue))
{
Response.Redirect("xls.aspx?e=" + ese.ToString() + "&a=" + ddl.SelectedValue);
}
else
{
Response.Redirect("xls.aspx?e=" + ese.ToString());
}
}