using System.Reflection;

 Control myView=  LoadControl("~/my_Control//myUserControl.ascx");

//設定屬性值

myView.GetType().GetProperty("這邊填寫在myUserControl.ascx裡面的屬性").SetValue(myView,"要設定的值", null);

//取得屬性值

myView.GetType().GetProperty("這邊填寫在myUserControl.ascx裡 面的屬性").GetValue(myView, null)

arrow
arrow
    全站熱搜

    welkingunther 發表在 痞客邦 留言(0) 人氣()