Transformation

Monjoie Dominique asked on January 23, 2018 20:42

I'm looking for hours about a solution to display a field following the value of another one but the result is still the same. I can change the value otf the conditional field, it doesn't change anything.

The aim is to display mobile number if people wish it so I have 2 fields : Displ_GSM (0 or 1) and the field with the number (GSM). This is one of the things I tried but without success.

<%# IfCompare(Eval("Displ_GSM"),1, (IfEmpty(Eval("GSM"),"", Eval("GSM") + "
")),"") %>

Is there someone to help me. Thanks,

Correct Answer

Brenden Kehren answered on January 23, 2018 21:13

Something like this should work. Place your "GSM" field within a placeholder and then set the visibility of the placeholder based off of the "Displ_GSM" field.

<asp:PlaceHolder ID="phGSM" runat="server" Visiblity='<%# Eval<bool>("Displ_GSM") %>'>
  <div>Telephone: <%# Eval("GSM") %></div>
</asp:PlaceHolder>
1 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.