textbox失去焦点要响应哪个事件?在客户端处理用onblur,在服务端处理呢?
谢谢!

解决方案 »

  1.   

    winform是LostFocus,不知道webapplication有没有
      

  2.   

    ajax..onblur="aaa();"function aaa()
    {
    _Default.Test();
    }default.aspx
    [AjaxPro.....]
    public void Test()
    {
    .........
    }
      

  3.   

    // .aspx
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="我被隐藏啦" style="display:none" />// .aspx.cs
    protected void Page_Load(object sender, EventArgs e)
    {
    // 1.x
    // TextBox1.Attributes["onblur"] = Page.GetPostBackEventReference(Button1); 
    // 2.0
    TextBox1.Attributes["onblur"] = ClientScript.GetPostBackEventReference(Button1, null);
    }protected void Button1_Click(object sender, EventArgs e)
    {
    Response.Write(DateTime.Now); 
    }