<td align="right" style="height: 26px">价 格:</td>
<td style="width: 258px; height: 26px;">
<asp:TextBox ID="tbPrice" runat="server" Text="¥"></asp:TextBox>
</td>
<td align="right" style="height: 26px; width: 56px;">折 扣:</td>
<td style="width: 231px; height: 26px;">
<asp:TextBox ID="tbDiscount" runat="server" Width="150px"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right">折 后 价:</td>
<td style="width: 258px">
<asp:TextBox ID="tbDiscountPrice" runat="server" onfocus="DiscountPrice();"></asp:TextBox>
</td>
function DiscountPrice()
{
var discountPrice = document.getElementById("tbDiscountPrice").value;
var Price = document.getElementById("tbPrice").value.substring(1);
var Discount = document.getElementById("tbDiscount").value;
if(Price != "" && Discount != "")
{
discountPrice = Price * Discount/10;
document.getElementById("tbDiscountPrice").value = "¥" + discountPrice
}
else
{
document.getElementById("tbDiscountPrice").value = "";
}
}根据价格和折扣价,用JS自动生成折后价的数据,为什么存入折后价的数据到数据库的时候,总是不行啊!flyticket.DiscountPrice = Convert.ToInt32(tbDiscountPrice.Text.Substring(1))
解决方案 »
- 告急!请高手指点迷惑
- visual studio 2010 数据库连接配置
- 网站的序列号,一般取客户电脑上的什么硬件标识好呢,
- 求写个登录界面,,我是新手,求详细代码。
- ASP.NET操作CSV 文件 更新报错
- 共有的问题:关于同一页面中回送太多,都怎么处理呢?
- Asp.net 不用 WebForm 和其他组件如何实现文件上传
- load report failed 问题。 求助 ~~
- ASP.NET大型OA源码转让,C#+SQL SERVER
- 如何取得地址?
- asp.net 中 数据库有TIME字段 我想在用数据绑定控件取数据的时候 做一个分周显示 请问怎么做 什么数据控件都可以 解决问题后 立即给分
- c# 如何从最后一个字符开始查找指定的字符?
这句没有异常的话就应该能够可以的。
出异常则有可能tbDiscountPrice没有赋值。或者更改了他的值并设为空,调试跟踪它!