Please refer this code.
Here i have used Style.
HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
function VisiblePanel() {
document.getElementById("<%=Panel1.ClientID %>").style.display = "Block";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Panel runat="server" ID="Panel1" Style="display: none;">
This is the panel content
</asp:Panel>
<div>
<asp:Button Text="Download File" OnClick="DownloadFile" OnClientClick="VisiblePanel();"
runat="server" />
</div>
</form>
</body>
</html>
Namespace
using System.IO;
C#
protected void DownloadFile(object sender, EventArgs e)
{
Response.ContentType = ContentType;
Response.AppendHeader("Content-Disposition", "attachment; filename=" + Path.GetFileName(Server.MapPath("~/Files/PDF.pdf")));
Response.WriteFile(Server.MapPath("~/Files/PDF.pdf"));
Response.End();
}