【发布时间】:2021-11-03 17:27:33
【问题描述】:
我可以在 asp.net 中使用 jquery 将文本框更改事件称为文本更改吗?
所以,我希望在用户输入数字时完成操作。
Default.aspx
<asp:TextBox ID="txtCount" CssClass="form-control" runat="server"></asp:TextBox>
<asp:TextBox ID="txtPrice" CssClass="form-control" runat="server" OnTextChanged="OnTextChanged"></asp:TextBox>
<asp:Label ID="lblTotal" CssClass="price" runat="server"></asp:Label>
Default.aspx.cs
protected void txtIskontoTutari_TextChanged(object sender, EventArgs e)
{
double price1=double.Parse(txtPrice.Text);
double count=double.Parse(txtCount.Text);
double total=0;
total=price1*count;
lblTotal.Text = string.Format("{0:#,##0.00}", total);
}
【问题讨论】:
标签: c# jquery asp.net textbox asp.net-ajax