protected void Button1_Click(object sender, EventArgs e)
        {
            this.Test_FileDownload(1);
            this.Button1.Visible = false;
        }上边的代码 测试后 button 还是可见的。。达不到要求

解决方案 »

  1.   

    问题补充一下。。
    this.Test_FileDownload(1); 会弹出文件下载窗体。我刚才测试了。如果屏蔽 this.Test_FileDownload(1); 是可以达到按钮不可见的。。只要弹出下载窗体,就不行有什么方法?
      

  2.   

    load 里:if(isposback) this.Test_FileDownload(1); 
                this.Button1.Visible = false; 
      

  3.   

    这样写
    protected void Button1_Click(object sender, EventArgs e) 

        this.Button1.Visible = false;     this.Test_FileDownload(1); 

      

  4.   

    protected void Button1_Click(object sender, EventArgs e)
    {
        this.Button1.Visible = false;    this.Test_FileDownload(1);

    这样还是不行吗?
      

  5.   


    <asp:Button id="button1" runat="sevrer" OnClientClick="this.style.display:none">
      

  6.   

    更正<asp:Button id="button1" runat="sevrer" OnClientClick="this.style.display='none'">
      

  7.   

    protected void Page_Load(object sender, EventArgs e)
        {
            if(!IsPostBack) {
                Button1.Attributes.Add("onclick", "Button1.style.display='none';"); 
            }
        }