【若能帮到您,望给个采纳该答案哦,谢谢!】
1、效果如下

2、代码如下
1)前端
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="test.asp.net.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:Label ID="Label1" runat="server" Text="49.00"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="更新" OnClick="Button1_Click"/>
<asp:Label ID="Label2" runat="server" Text="总金额为"></asp:Label>
<asp:Label ID="Label3" runat="server" Text=""></asp:Label>
</form>
</body>
</html>
2)后端代码
protected void Button1_Click(object sender, EventArgs e)
{
//获取数量
string num_text = TextBox1.Text;
int num = 0;
int.TryParse(num_text,out num);
//获取金额
string price_text = Label1.Text;
double price = 0.00;
double.TryParse(price_text, out price);
//计算金额
Label3.Text = (price * num).ToString("f2");//fN 保留N位,四舍五入;
}