is Txt1 a declared TextBox in your ascx file?Dim a As New Area = CType(LoadControl("Yourascx.ascx"),Area)
Form1.Controls.Add(a) 'Form1 is from <form id=Form1 runat=server> in your page
Response.Write(a.GetValue)

解决方案 »

  1.   

    form1里我已将 ascx文件拖入去了
    form1.controls.add(A)没有必要了吧
    txt1 已申明了
      

  2.   

    assume Area is the code-behind class for your user control, declare in your Page class:protected a as Area把这个ascx文件放在aspx里了,想在aspx文件里获取这个textbox的值如何获取?
     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Response.Write(a.GetValue)
        End Sub