Vorrei creare un contatore per un link che sacrica a sua volta un file.
<asp:Label ID="setDinPLabel" runat="server" Text="Label"></asp:Label>
<asp:LinkButton ID="setupDinPLinkButton" runat="server" OnClick="downloadLinkButton_Click"
CommandArgument="1" CommandName="~/file/..">Setup Completo</asp:LinkButton>
protected void downloadLinkButton_Click(object sender, EventArgs e)
{
LinkButton link = sender as LinkButton;
Int32 idDownload = Convert.ToInt32(link.CommandArgument);
COD.Download_DataSetTableAdapters.DownloadTableAdapter ta = new Dinamico.COD.Download_DataSetTableAdapters.DownloadTableAdapter();
ta.Update_download(idDownload);
ta.Dispose();
string url = link.CommandName;
string path = Server.MapPath(url);
string nomeFile = Path.GetFileName(path);
Response.Clear();
Response.ContentType = "application/exe";
Response.AddHeader("Content-Disposition", "attachment; filename=" + nomeFile);
Response.WriteFile(path, false);
Response.End();
I problemi sono 2
1. al Response.End(); mi da questo errore: Thread interrotto
2. vorrei aggiornare la Label dopo il click ma ho usato il UpdatePanel ma non funziona.
Qualcuno sa aiutarmi oppure consigliarmi uno script corretto?
Grazie mille