我正在打开一些具有这样的代码的面板
<td rowspan="2">
<br />
<asp:UpdatePanel ID="updatePnl" runat="server">
<ContentTemplate>
<asp:LinkButton ID="lnkYurLevel" runat="server" ForeColor="#009999" Text="What are my next steps?"
Font-Size="Medium" OnClick="lnkYurLevel_Click"></asp:LinkButton>
</ContentTemplate>
</asp:UpdatePanel>
</td>
protected void lnkYurLevel_Click(object sender, EventArgs e)
{
if (lblFileName.Text != "")
{
string path = Server.MapPath(@"~\downloads\" + lblFileName.Text);
System.IO.FileInfo file = new System.IO.FileInfo(path);
if (file.Exists)
{
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file.FullName);
Response.End();
}
else
{
Response.Write("This file does not exist.");
}
}
}
并单击按钮,我正在打开一个要下载的文件,但该下载不会出现,因为当它没有保存在要通过模型弹出窗口打开的面板中时它正在工作。现在,当它被放置在要通过模型弹出窗口打开的面板中时。它不起作用。是什么原因?