日期:2014-05-17  浏览次数:20421 次

请问这表达式哪里错了 说字符串格式不正确....
 <asp:Label ID="Label3" runat="server" Text='<%#"总金额为:"+Convert.ToString(Convert.ToDecimal(TextBox1.Text)*Convert.ToInt32(TextBox2.Text)) 
    %>'></asp:Label>

------解决方案--------------------
你看看值aaa.Text呀,是不是空的,或者非数字型...不确定写法,可以到后台去点出来啊.
------解决方案--------------------
还有你的TextBox中输入的小数是不是有空格或者小数点是全角的字符,建议仔细检查下

<asp:Label ID="Label3" runat="server" Text='<%#"总金额为:"+Convert.ToString(Convert.ToDecimal(TextBox1.Text.Trim())*Convert.ToInt32(TextBox2.Text.Trim())) 
    %>'></asp:Label>