怎样获取母版页上的控件????????????母版页叫 A 里面有个控件 ASP:Label1用B.aspx 包含 A.在B.aspx.cs 里怎么改变 ASP:Label1的 text????

解决方案 »

  1.   

    dim lbl as label=me.master.findcontrol("label1")
    if not lbl is nothing then
    lbl.text="xxxxx"
    end if
      

  2.   

    me 也可以不用,你的要译成C#
      

  3.   

    比如母版页上的一个textbox1
    内容页里有个 textbox2
    让textbox2 显示 textbox1中的内容:textbox2.text = (Master.FindControl("textbox1") as TextBox).text;
      

  4.   

    textbox2.text = Ctype(Master.FindControl("textbox1"),TextBox).text