Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 395519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:27:43+00:00 2026-05-12T16:27:43+00:00

<asp:TemplateField HeaderText=Audio> <ItemTemplate> <asp:Image ID=playImage runat=server ImageUrl=~/images/nextpg.gif Visible='<%# (Eval(available)==Y) ? true : false %>’

  • 0
<asp:TemplateField HeaderText="Audio">
    <ItemTemplate>
        <asp:Image ID="playImage" runat="server"
            ImageUrl="~/images/nextpg.gif"
            Visible='<%# (Eval("available")=="Y") ? true : false %>' />
    </ItemTemplate>
</asp:TemplateField>

In my query I am returning the “available” column which is populated with a letter of Y or N. For some reason the evaluation of this expression is never true. If I change it to != instead of == it will always be true. That leads me to believe the Eval("available")=="Y" is simply not evaluating as expected.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:27:43+00:00Added an answer on May 12, 2026 at 4:27 pm

    After much messing around, this finally worked:

    <%# ((String)Eval("available")).Equals("Y") ? true : false %>
    

    The issue seems to be that you can’t use == but instead you must use the String.Equals() method. I’m not sure why but that’s just the way it is.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my code: <asp:TemplateField HeaderText=Email> <ItemTemplate> <asp:TextBox ID=txtEmail runat=server Text='<%# Eval(Email) %>' Width=88px
I try : <asp:TemplateField HeaderText=Local > <ItemTemplate> <asp:TextBox ID=txtLocal runat=server Text='<%# Eval(LPName) == null
<asp:UpdatePanel ID=asd runat=server> <ContentTemplate> <asp:GridView ID=gvUpdate runat=server> <Columns> <asp:TemplateField HeaderText=DATE> <ItemTemplate> <asp:Label ID=lblDate runat=server
my gridview looks like: <asp:GridView ID=gvFiles runat=server > <Columns> <asp:TemplateField HeaderText=Notification Sent to> <ItemTemplate>
i have a dropdownlist in a gridview <asp:TemplateField HeaderText=Backup Frequency> <ItemTemplate> <asp:DropDownList ID=DropDownList1 runat=server>
<asp:GridView ID=GridView1 runat=server> <Columns> <asp:TemplateField HeaderText=FileName> <ItemTemplate> <asp:HyperLink ID=HyperLink1 runat=server NavigateUrl= Text=></asp:HyperLink> </ItemTemplate> </asp:TemplateField>
<asp:TemplateField HeaderText=Select> <ItemTemplate> <asp:CheckBox ID=chkSelected runat=server Checked=false></asp:CheckBox> </ItemTemplate> </asp:TemplateField> elow code works fine but
i have: <asp:TemplateField HeaderText=Choose Option> <ItemTemplate> <asp:RadioButtonList ID=rdbChoice runat=server RepeatDirection=Horizontal> <asp:ListItem Value=A>A</asp:ListItem> <asp:ListItem Value=B>B</asp:ListItem>
<asp:GridView ID=GridView1 runat=server CssClass=style29> <Columns> <asp:TemplateField HeaderText=Send Message to Group> <ItemTemplate> <asp:LinkButton ID=LinkButton2 runat=server
<asp:DetailsView... <asp:TemplateField HeaderText=My CheckBox SortExpression=DataID > <InsertItemTemplate> <asp:CheckBox ID=T01cbx runat=server Visible =false Checked='<%# Bind(DataID)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.