我网页上所有的Click和Change事件反应太慢了,但显示数据又不慢.
这是其中一个Click事件代码:protected void menu1_Click(object sender, EventArgs e)
    {
        if (DropDownList1.Visible == false)
        {
            DropDownList1.Visible = true;
            DropDownList2.Visible = false;            topmenu1.Attributes.Clear();
            topmenu.Attributes.Clear();
            topmenu.Attributes.Add("class", "top_menut");            
            topmenu1.Attributes.Add("class", "top_menut1");
            topmenu1.Attributes.Add("onmouseover", "menu_over1(this);");
            topmenu1.Attributes.Add("onmouseout", "menu_out1(this);");
        }
    }可能会有哪些方面的问题呢?

解决方案 »

  1.   

    topmenu1是什么东东?
    是不是数据量特别大?
      

  2.   


    topmenu.Attributes.Add("class", "top_menut");            
                topmenu1.Attributes.Add("class", "top_menut1");
                topmenu1.Attributes.Add("onmouseover", "menu_over1(this);");
                topmenu1.Attributes.Add("onmouseout", "menu_out1(this);");把上面的代码一行行注释掉以后再执行,就知道是哪一行慢了。
    然后再把那行调用的代码贴出来看看。
      

  3.   


    <div class="top_menut" runat="server" id="topmenu1"></div>
      

  4.   

    我认为这不是某一些部份代码的问题.
    因为我的登录也很慢,
    就连执行这句也很慢:
     protected void btnreg_Click(object sender, EventArgs e)
        {
            ScriptManager.RegisterClientScriptBlock(UpdatePanel1, typeof(UpdatePanel), "s", "alert('提示')", true);
        }
      

  5.   

    UpdatePanel1本来就很影响速度。
      

  6.   

    是不是,你本地的东西打开的太多,增加了cpu和内存的负担。