Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UserControl myUC = (UserControl).Load("~/customUserControl.ascx");
- Bob b = (Bob).Load("~/customUserControl.ascx");
- class Bob : UserControl{
- public string User { get; set;}
- }
- b.User = theuser;
- MyUserControl myUCTyped = (MyUserControl)myUC;
- myUCTyped.ThePublicProperty = "some value";
- MyUserControl myUC = (UserControl).Load("~/customUserControl.ascx") as MyUserControl;
- string result = myUC.user;
- public partial class todo : System.Web.UI.UserControl
- {
- private string mysecondteststring;
- public string setValue
- {
- get
- {
- return mysecondteststring;
- }
- set
- {
- mysecondteststring = value;
- }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- // my code
- }
- }
Add Comment
Please, Sign In to add comment