划分文本框值 [英] divide the textbox values

查看:91
本文介绍了划分文本框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的Frnds,正在使用asp.net,c#,Sqlserver 2005-Web应用程序.

我的网络表单上有三个文本框,还有一个除法按钮.

因此,如何在单击划分按钮时将Textbox1值划分为textbox2并在textbox3中显示.

请帮帮我.

谢谢.

Dear Frnds, am working on asp.net, c#,Sqlserver 2005 - WEB APPLICATION.

I have three Textboxes on my webform and a Divide button.

so, how to divide the Textbox1 value to textbox2 and display in textbox3 when divide button clicks.

Please help me.

THANKS.

推荐答案

buttonclick event
{
try
{
txt3.text = int.parse(txt1.text)/int.parse(txt2.text);
}
catch(exception ex)
{
Response.write(ex.Message);
}

这是您的问题吗?



试试这个:
Hi,
Try this:
int res=0;
try{
res=Convert.ToInt32(TextBox1.Text)/Convert.ToInt32(TextBox2.Text);
TextBox3.Text=res.ToString();
}
catch(Exception ex){}



--Amit



--Amit


这篇关于划分文本框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆