SRJ
SRJ

Reputation: 198

Conditional Operator in asp.net repeater databinding

I have this in asp.net source page (while binding repeater with data

 <%#Convert.ToBoolean(Eval("IsTax")) ? "Yes": "No Tax"%>

I Need the following two in place of Yes. How can i?

  <%#Eval("TaxAmount")%>
<%#Eval("TaxGroup")%>

Upvotes: 0

Views: 833

Answers (1)

Amit Singh
Amit Singh

Reputation: 8109

Try like this....

<%#Convert.ToBoolean(Eval("IsTax")) ? (Eval("TaxAmount").ToString()+" " 
+Eval("TaxGroup").ToString()): "No Tax"%>

Upvotes: 1

Related Questions