if statement to determine label visibility

Last post 08-26-2008 6:34 PM by Mikesdotnetting. 1 replies.

Sort Posts:

  • if statement to determine label visibility

    08-26-2008, 6:02 PM
    • Member
      3 point Member
    • beyule
    • Member since 08-26-2008, 9:56 PM
    • Posts 26

    Disclaimer: I'm new

     I have a label that works OK using the following:

     <asp:label id="alternateAccountNumberLabel" style="Z-INDEX: 123; LEFT: 472px; POSITION: absolute; TOP: 64px" runat="server"

    Width="80px" Text='<%# DataBinder.Eval(account, "Tables[account].DefaultView.[0].alternate_account_number") %>'

    ToolTip="Alternate Account Number"></asp:label>

    What I would like to do is make this label invisible if the Databinder.Eval portion evaluates to null.  I'm not sure if this would be easier here, inline, or in the code behind page,

    In English:

    if '<%# DataBinder.Eval(account, "Tables[account].DefaultView.[0].alternate_account_number") %>'  is not null then asp:label visible = true else false.

     If anyone could help me out I would appreciate it. 

    Thanks

  • Re: if statement to determine label visibility

    08-26-2008, 6:34 PM
    Answer

    You should get the hang of it from this: http://www.mikesdotnetting.com/Article.aspx?ArticleID=18

     

    Regards Mike
    [MVP - ASP/ASP.NET]
    My site    Please help - URGENT!!!    What ASP.NET can and can't do
Page 1 of 1 (2 items)