I have included a user control in another statically following code :
place the folowing directive in the asp code of the parent page or usercontrol:
<
Say your usercontrol was this:
<%@ Control Inherits="Project.MyControl" Codebehind="MyControl.ascx.cs" %>
Your control code-behind:
namespace Project
{
public partial class MyControl : UserControl
{
public string MyTextProperty
{
get { return TB.Text; }
set { TB.Text = value; }
}
}
}
In your parent page that included the control, like this:
<%@ Register src="~/MyControl.ascx" tagname="MyControl" tagprefix="uc1" %>
You can use that property in code:
MyControlID.MyTextProperty = "bob";