【问题标题】:How to empty textbox befor ModalPopupExtender show?如何在 ModalPopupExtender 显示之前清空文本框?
【发布时间】:2014-02-02 15:16:48
【问题描述】:

我的代码是从文本框中插入文本,我的代码做得很好,但我想在 ModalPopupExtender 显示之前清空文本框。我做了我的代码,但它没有工作。

 protected void Btn_monthlyemployee_Click(object sender, ImageClickEventArgs e)
{
    var Comment = (TextBox)((ImageButton)sender).Parent.FindControl("txt_monthlyemployee");

    ftier.Addcomment(LblMonthlyPID.Text, LoggedUserID, txt_monthlyemployee.Text, DateTime.Now, DateTime.Now, false);

    Comment.Text = string.Empty;
    ModelExtenderPost.Show();


}

【问题讨论】:

    标签: c#-4.0 asp.net-ajax


    【解决方案1】:

    虽然我给你一些很好的技术来解决这个问题,但你没有提供足够的信息

    你的代码应该可以工作,我不知道为什么它不工作

    你可以有一个jquery方法

    当你的按钮被点击时

    $('#idofmonthlyeployeed').click(function()
    {
          $('#commentboxid').val('');
          return false;   
    });
    

    你可以在这里看到工作示例Fiddle

    或者,如果您的 idofmonthlyeployeed

    没有触发按钮,您可能会遇到 更新面板 问题

    所以请添加idofmonthlyeployeed

    的触发器

    希望对你有所帮助.....:)

    【讨论】:

      猜你喜欢
      • 2023-03-26
      • 1970-01-01
      • 2013-10-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-23
      相关资源
      最近更新 更多