T
timpera2501
Hello,
I'm a bit of a newb, so please forgive me if this is a stupid question.
I have a simple formview that contains only one control (a label control
called "COUNTLabel"). The formview is bound to an ObjectDataSournce that
returns one value named "COUNT" which is assigned to this label control.
In the code behind, I've been trying to programmatically set the "Visible"
property of the formview control based on the value in the "COUNTLabel" label
control that is within the formview.
In the DataBinding event for the formview I have the following code:
if (EmergencyTTs.Row.FindControl("COUNTLabel").Equals(0))
{
EmergencyTTs.Visible = false;
}
else
{
EmergencyTTs.Visible = true;
}
But the value for "EmergencyTTs.Row.FindControl("COUNTLabel")" is always
null. What am I doing wrong?
Is there a better/easier way to go about going this?
I'm a bit of a newb, so please forgive me if this is a stupid question.
I have a simple formview that contains only one control (a label control
called "COUNTLabel"). The formview is bound to an ObjectDataSournce that
returns one value named "COUNT" which is assigned to this label control.
In the code behind, I've been trying to programmatically set the "Visible"
property of the formview control based on the value in the "COUNTLabel" label
control that is within the formview.
In the DataBinding event for the formview I have the following code:
if (EmergencyTTs.Row.FindControl("COUNTLabel").Equals(0))
{
EmergencyTTs.Visible = false;
}
else
{
EmergencyTTs.Visible = true;
}
But the value for "EmergencyTTs.Row.FindControl("COUNTLabel")" is always
null. What am I doing wrong?
Is there a better/easier way to go about going this?