本文介绍了下载文件后按钮可见性为假,面板可见性为真的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

HI
任何人都可以帮助我

下载文件后,我尝试按钮的可见性为false,panelemil的可见性为true

HI
Any one can help me i am try to

i try visibility false of the button after download file and visibility of panelemil is true

protected void linkbtndow_Click(object sender, EventArgs e)

{

try
{

paneladdemail.Visible = true;

linkbtndow.Visible = false;

String myFile = "Email Id,Name";

String myFileName = "Addressbook.csv";

Response.Clear();

Response.ContentType = "text/comma-separated-values";

Response.AddHeader("content-disposition", "attachment; filename=" + myFileName);

Response.Buffer = true;

Response.Write(myFile);

Response.End();

}

catch

{}

}



但是我们只下载文件

可见性不是由此设置的

任何人都可以向我提供正确的代码...

您好,谢谢提示

如果我使用下面给出的答案

该行的含义是什么,以及如何设置此

您好:亲爱的给定的javascript并在其他页面上浪费了下载代码,但这也无法设置按钮false和面板可见性

请问您能输入正确的代码或提示其他任何过程吗?

等待回复

谢谢



but our this only download the file

visibility is not set by this

any one can provid the correct code to me......

Hello thanks for hint

if i use the the answer given below

what is meaning of this line and how to set this

hello Dear your given javascript and wirte the download code on other page but this also not able to set the of button false and panel visiblity

plz can you the correct code or hint any other process

wating reply

thanks

推荐答案

<asp:button id="btnDownload" runat="server" OnClientClick="DownloadMe();return false;" Text="Download File" />
<script type="text/javascript">
<!--
      function DownloadMe(){
       window.open('./DownloadFile.aspx','');
       document.getElementById('<%=btnDownload.ClientId %>').style.display='none';//this line hides Download button on client side by Javascript
      }
--></script>


这篇关于下载文件后按钮可见性为假,面板可见性为真的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 20:50