我有 asp.net 网站,其中包括一些按钮计算。当我按下按钮时,我的计算工作正常,但首先页面刷新,然后计算显示在标签上。我想直接在标签上进行计算。无需提神。我给出一些代码。
ps 还有Page_Load 有接收每日汇率的功能
ASP
<asp:Button ID="Button1" runat="server" BackColor="#990000"
BorderColor="#333333" ForeColor="White" onclick="Button1_Click" Text="Calculate"
Width="85px" BorderStyle="Outset" style="margin-left: 20px"
ValidationGroup="grup1" />
按钮点击
protected void Button1_Click(object sender, EventArgs e)
{
double sayi1, sayi2, sayi3, hesap, sonuc;
sayi1 = Convert.ToDouble(Tb1.Text);
sayi2 = Convert.ToDouble(Tb2.Text);
sayi3 = Convert.ToDouble(Tb3.Text);
if (Tb1.Text.Contains(".") || Tb2.Text.Contains(".") || Tb3.Text.Contains("."))
{
...
...
...