I need to use triple nested if statement using ASP.NET Web forms binding expression. I have tried the following:
<asp:TemplateField HeaderText="Price">
<ItemTemplate>
$ <%# Convert.ToBoolean(Eval("TierPricing")) ? Eval("PraviTier") + " per feet" : Convert.ToBoolean(Eval("IsPricingIndex")) ? Eval("ProductTierPrice") + " per feet" : Convert.ToString(Eval("SubCategoryName"))=="Custom kits" ? Eval("Price") + " per feet" : Eval("Price") + " per package" %></p>
</ItemTemplate>
</asp:TemplateField>
The problem arises with first if statement, its not writing the value I want it to write ... :/ Can someone help me out how to format this if statement properly??
Eval("PraviTier") should write - 1.5 Eval("ProductTierPrice") should write - 1.25
Instead Eval("PraviTier") is writing 1.25 value... why is that???
Here is a picture showing what I mean:
Any hints??
P.S. Its as if the first If statement is completely ignored?!
Edit: I've checked what does the stored procedure returns... Eval("TierPricing") is set to true in database... so what could possibly be the issue here? :/