有点没明白,可以直接拉到当前页面的。拉过来后,本页面就已经存在了,该用户控件的类。
控件名.属性就可以了。当然属性要在用户控件中,声名成public的。

解决方案 »

  1.   

    我不能直接拉. 要用程序写.是程序自动加载的.Control myControl = Page.LoadControl("ShowArticlesCat.ascx"); 
    这样以后. 我不知道参数怎么写
      

  2.   

    举个例子:用户控件拉入页面后。会生成一个id :假设为userControl1再假设用户控件中有一个属生。public string paraUser;那么我们取paraUser就可以直接在你的母页面。userControl1.paraUser 就可以了。
      

  3.   

    因为没有ID 所以不知道.  myControl.top也不行.
      

  4.   

    这是我测试成功过的例子:用户控件TestUserControl.aspx.cs private int _ID = 1;    public int ID
        {
            set
            {
                _ID = value;
            }
            get
            {
                return this._ID;
            }
        }     protected void Page_Load(object sender, EventArgs e)
        {
            Response.Write(_ID);//测试传进来的值
        }传值页面TestUserControl.aspx <%@ Reference Control="~/webUserControl.ascx" %>  <%--在页头加这一句代码--%>
    TestUserControl.aspx.cs  protected void Page_Load(object sender, EventArgs e)
        {
            Control c1 = Page.LoadControl("WebUserControl.ascx");     
            PlaceHolder1.Controls.Add(c1);
            WebUserControl w1 = (WebUserControl)c1;
            w1.ID = 2300; //这里设置用户控件的_ID的值
        }
    楼主你的结贴率有点低哦,太低的话很多人都不想回答的,希望问题解决了就结贴~