【问题标题】:How To get Child User Control Value on the Button Click of Parent User Control如何在父用户控件的按钮单击上获取子用户控件值
【发布时间】:2011-07-08 12:56:51
【问题描述】:

我在父用户控件上有一个按钮,在子用户控件上有一个文本框。

现在我想在单击父按钮单击时从文本框中获取文本。

我的意思是我想从父级获取子用户控件值。

我如何在 asp.net 中做到这一点。

【问题讨论】:

  • dalvir ,您应该为这些使用事件,在子控件上引发事件并在父控件上进行监听

标签: asp.net


【解决方案1】:

dalvir,你应该为这些使用事件,在子控件上引发一个事件并在父控件上监听同样的事件

这里有你的答案

Sharing value from child to parent control

【讨论】:

    【解决方案2】:

    这些都在你的表单控件集合中......你可以试试

    TextBox text = Form.FindControl("name") as TextBox; 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-09
      • 1970-01-01
      • 2013-09-02
      • 1970-01-01
      • 2016-08-30
      • 1970-01-01
      相关资源
      最近更新 更多