I am using the application scenario Load On Demand example for the tab strip, and I was wondering how I could pass a variable to the user control. I will have a numeric value (UnitNumber) between 1 and 4, for each number I will need to create a tab. So if the number is three, I need to create 3 tabs. I am going to use the same ascx page, and I want it to know which tab it is: 1, 2, or 3 for example.
I created unit.ascx, and it contains the following:
the aspx page looks like your example:
so, in the code above, how do I add something like: userControl.UnitNumber = 2
I created unit.ascx, and it contains the following:
private string _unitNumber; |
public string UnitNumber |
{ |
get{return _unitNumber; } |
set{ _unitNumber = value; } |
} |
protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e) |
{ |
string userControlName = e.PageView.ID.Replace(" ", "") + ".ascx"; |
Control userControl = Page.LoadControl(userControlName); |
userControl.ID = e.PageView.ID + "_userControl"; |
e.PageView.Controls.Add(userControl); |
} |