Monday, March 26, 2012

pass value to user control from aspx

I have a user control:

- using LoadControl("MyCtrl.ascx")
MyCtrl _mycontrol = (MyCtrl)LoadControl("MyCtrl.ascx")
Page.Controls.Add(_mycontrol);
_mycontrol.Text

it will be loaded when some events fired.
so how can I pass value to this user control from aspx template file.Hi,

Create a property in user control and set the property in template file or
code file.

Prakash.C

"pei_world" wrote:

> I have a user control:
> - using LoadControl("MyCtrl.ascx")
> MyCtrl _mycontrol = (MyCtrl)LoadControl("MyCtrl.ascx")
> Page.Controls.Add(_mycontrol);
> _mycontrol.Text
> it will be loaded when some events fired.
> so how can I pass value to this user control from aspx template file.
>

0 comments:

Post a Comment