findcontrol problems

Posted by saadan on Stack Overflow See other posts from Stack Overflow or by saadan
Published on 2010-06-10T16:46:31Z Indexed on 2010/06/10 16:52 UTC
Read the original article Hit count: 189

Filed under:
|
|

why can not I do this

I have a data list which retrieves some data out. if the label1 is we say 123 then a second label must be invisible

    Label Label = (Label)DataList2.FindControl("LabelName");
    Label Label2 = (Label)DataList2.FindControl("LabelName2");

    if (Label.Text == "123")
    {
        Label2.Visible = false;
    }

© Stack Overflow or respective owner

Related posts about c#

Related posts about label