在页面a上 包含一个用户控件b<1>将a上一个TextBox值,传到b上一个TextBox中 该怎么做?
<2>如果点用户控件b上一个Button,将结果传到c页面,需要什么特殊的操作吗?

解决方案 »

  1.   

    呵呵,对于你第一个问题哄,解决如下:,你在用户控件b里面放个label控件,id是lblmsg
    然后在调用用户控件这个页面a里放个textbox和一个button然后button的事件如下:    Private Sub btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click
            Dim mycon As TestUserControl = CType(Me.FindControl("logins1"), TestUserControl)
            Dim lbl As Label = CType(mycon.FindControl("lblmsg"), Label)
            lbl.Text = TextBox1.Text
        End Sub这样就能实现你要的功能了哈!第二个问题,很简单啊。在b上放个button然后在onclick事件中写比如response.redirect("c.aspx?str=传到了")就可以了嘛。
      

  2.   

    在B中这样写:(假设A中的TextBox命名为txtBox1)(C#)
    (TextBox)this.Parent.Page.FindControl("txtBox1");这样就得到了A页控件中的控件。