Dim Control AsObject If (Request.Cookies("UserInfo")("e_id") <>"") Then Control =New ctl_pds_fcc Control =CType(Me.Page.LoadControl("control/ctl_pds_fcc.ascx"), ctl_pds_fcc) 'CType(Control, ctl_pds_fcc).ID = i CType(Control, ctl_pds_fcc).e_id = Request.Cookies("UserInfo")("e_id") '員工代碼 CType(Control, ctl_pds_fcc).from_id = Request.QueryString("from_pub_id") PlaceHolder1.Controls.Add(Control) EndIf
PrivateSub Page_Load()Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load '在這裡放置使用者程式碼以初始化網頁 Try If (IsPostBack =True) Then Return EndIf If po_id =""Or e_id =""Or from_id =""Then Return EndIf GetUserInfo(e_id) BindGrid(po_id, e_id, from_id) BindGridZL(from_id, e_id) ' 職能評估紀錄 BindGridLD(from_id, e_id) ' 建議輪調與晉升紀錄 Catch Ex As System.Exception ErrorHandler(Ex.ToString(), Message) EndTry End Sub ' 定义一些方法(外部d) Public str_e_id AsString PublicProperty e_id()Property e_id() AsString Get Return str_e_id EndGet Set(ByVal Value AsString) str_e_id = Value EndSet End Property Public str_po_id AsString PublicProperty po_id()Property po_id() AsString Get Return str_po_id EndGet Set(ByVal Value AsString) str_po_id = Value EndSet End Property Public str_from_id AsString PublicProperty from_id()Property from_id() AsString Get Return str_from_id EndGet Set(ByVal Value AsString) str_from_id = Value EndSet End Property End Class
cs: Dim Control As Object//////////////////////////////// If (Request.Cookies("UserInfo")("e_id") &lt;&gt; "") Then Control = New ctl_pds_fcc Cont...