I’ve written a Custom User Control which returns some user specific data. To load the Custom User Control I use the following line of code:
UserControl myUC = (UserControl).Load('~/customUserControl.ascx');
But how can I access string user inside the User Control myUC?
Let’s call your usercontrol ‘Bob’
If you Inherit from UserControl in Bob, then I guess it’s safe to do this:
For the user part, I can’t really follow what you want to do, is the ‘user’ in the class were you create the ‘Bob’ usercontrol and you want to set a property in the ‘Bob’ usercontrol or is it the other way around?
For the first one you should create a property in your usercontrol.
and then set it when after you create ‘Bob’ instance.