Input string is not in correct format ternary operator using in grid view .

Posted by A.Goutam on Stack Overflow See other posts from Stack Overflow or by A.Goutam
Published on 2012-11-29T05:02:14Z Indexed on 2012/11/29 5:03 UTC
Read the original article Hit count: 126

Filed under:
|
|
|

i am using this ternary operator for the display the value but it always says that Input string is not in correct format .

 <asp:TextBox ID="txtPerOfBase" runat="server" Style="text-align: right;" Text='<%# decimal.Parse(Eval("CommissionableAmountBase").ToString()) == 0 ? Eval("CommissionablePercentBase","{0:N2}"): Eval("CommissionableAmountBase","{0:N2)")%>'
                                                                        Width="80px"></asp:TextBox> 

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET