N
Nauman
Hi All,
I've created two custom composite controls.
The first one is just a composition of a dropdown and a button. The user is
supposed to select a list item and click the button so that I can get the
value to perform server-side processing. This works just fine.
Where as the second one is a much larger control with many other controls
including the first one. I've instantiated the first control in the Second
one's CreateChildControls method. When I select a value in the embedded
(first control) control's dropdown list and click its associated button,
everything seems to work fine except that, I loose the selected index of the
nested(first control's) control's listbox.
PS: One more thing worth mentioning is that the list values for my first
control are populated in the OnLoad event of the control itself.
protected override void OnLoad(EventArgs e)
{
EnsureChildControls();
if(!Page.IsPostBack)
{
GetJobStates();
if(StateList != null)
{
ddlState.Items.Clear();
for(int iCtr = 0; iCtr < StateList.Length; iCtr++)
{
ddlState.Items.Add(StateList[iCtr]);
}
}
}
base.OnLoad (e);
}
If I remove the "if(!Page.IsPostBack)" check then the second control works
fine with the embedded first control, but the first control doesn't works
independently (without nesting/embedding)
Any Ideas???
Regards
Nauman
I've created two custom composite controls.
The first one is just a composition of a dropdown and a button. The user is
supposed to select a list item and click the button so that I can get the
value to perform server-side processing. This works just fine.
Where as the second one is a much larger control with many other controls
including the first one. I've instantiated the first control in the Second
one's CreateChildControls method. When I select a value in the embedded
(first control) control's dropdown list and click its associated button,
everything seems to work fine except that, I loose the selected index of the
nested(first control's) control's listbox.
PS: One more thing worth mentioning is that the list values for my first
control are populated in the OnLoad event of the control itself.
protected override void OnLoad(EventArgs e)
{
EnsureChildControls();
if(!Page.IsPostBack)
{
GetJobStates();
if(StateList != null)
{
ddlState.Items.Clear();
for(int iCtr = 0; iCtr < StateList.Length; iCtr++)
{
ddlState.Items.Add(StateList[iCtr]);
}
}
}
base.OnLoad (e);
}
If I remove the "if(!Page.IsPostBack)" check then the second control works
fine with the embedded first control, but the first control doesn't works
independently (without nesting/embedding)
Any Ideas???
Regards
Nauman