Rameez Javed

Rameez Javed

  • NA
  • 395
  • 62.3k

Eval If else if and else

Feb 15 2020 6:56 AM
I'm done some conditions with if and else in eval on client side, but now im trying to do something like below, but I don't have the concept of else if in eval,  if there is any way to do, urgently response will be highly appreciated.
  1. style='<%# If(Eval("Ranking").ToString() = "Economy", "width: 0%") : If(Eval("Ranking").ToString() = "EcoPlus", "width: 0%") : If(Eval("Ranking").ToString() = "Standard", "width: 0%") : If(Eval("Ranking").ToString() = "1 Star", "width: 20%") : If(Eval("Ranking").ToString() = "2 Star", "width: 40%") : If(Eval("Ranking").ToString() = "3 Star", "width: 60%")  : If(Eval("Ranking").ToString() = "4 Star", "width: 80%") : If(Eval("Ranking").ToString() = "5 Star", "width: 100%") %>'  
Here is a code snippet for if else only and I'm in need of If else if else if else if and else
 
  1. Style='<%# If(Eval("Ranking").ToString() = "Eco", "40%", "60%") %>'  
Thanks in Advance

Answers (3)