D
Dan
Hi, I have a repeater, and on post-back when I try to access the Text
properties of <asp:label>'s in the repeater, they are all String.Empty
(which they are not when the page is rendered.)
Anyone know why this would be? I would expect the repeater to persist
itself and it's controls into the viewstate...
Thanks much!
Dan
Here's my code (note that the "Checked" property of the checkbox is
persisted to the viewstate correctly):
// loop through all of the rows in the repeater
foreach (RepeaterItem ri in _rptrColumns.Items) {
// if the row is checked, add it to the DataTable
bool isChecked = ((CheckBox)ri.FindControl("_cbxColumnsIsIncluded")).Checked;
if (isChecked) {
userColumns.Rows.Add(new object[] {
((Label)ri.FindControl("_lblColumnsInternalName")).Text,
((Label)ri.FindControl("_lblColumnsUIValue")).Text,
ConvertEx.SafeToInt32(
((DropDownList)ri.FindControl("_lstColumnsOrder")).SelectedItem.Value)
});
}
}
properties of <asp:label>'s in the repeater, they are all String.Empty
(which they are not when the page is rendered.)
Anyone know why this would be? I would expect the repeater to persist
itself and it's controls into the viewstate...
Thanks much!
Dan
Here's my code (note that the "Checked" property of the checkbox is
persisted to the viewstate correctly):
// loop through all of the rows in the repeater
foreach (RepeaterItem ri in _rptrColumns.Items) {
// if the row is checked, add it to the DataTable
bool isChecked = ((CheckBox)ri.FindControl("_cbxColumnsIsIncluded")).Checked;
if (isChecked) {
userColumns.Rows.Add(new object[] {
((Label)ri.FindControl("_lblColumnsInternalName")).Text,
((Label)ri.FindControl("_lblColumnsUIValue")).Text,
ConvertEx.SafeToInt32(
((DropDownList)ri.FindControl("_lstColumnsOrder")).SelectedItem.Value)
});
}
}