我在一个按钮单击事件中有三个文本框如何获取asp.net中文本框的任何一个值 [英] i have three textboxes inside one button click event how to get the any one values of the textbox in asp.net
本文介绍了我在一个按钮单击事件中有三个文本框如何获取asp.net中文本框的任何一个值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
在这里,试试这个:
string _value =;
if(textbox1.Text!=)
{
_value = textbox1.Text;
}
if(textbox2.Text!=)
{
_value = textbox2.Text;
}
if(textbox3.Text!=)
{
_value = textbox3.Text;
}
On Buton Click事件你可以像下面一样声明三个变量
protected void Buton _Click(object sender, EventArgs e)
{
String xx;
String YY;
String ZZ;
if(txtbox1.text!='''')
{
xx = txtbox1.text;
}
if (txtbox2.text!= ' < span class =code-string>')
{
YY = txtbox2.text;
}
if (txtbox3.text!= < span class =code-string>' ')
{
ZZ = txtbox3.text;
}
}
hello !! i have three textboxes inside one button click event how to get the any one values of the textbox in asp.net..
解决方案
Here, try this:
string _value = ""; if(textbox1.Text != "") { _value = textbox1.Text; } if(textbox2.Text != "") { _value = textbox2.Text; } if(textbox3.Text != "") { _value = textbox3.Text; }
On Buton Click event You can Declare Three Variable Like Below
protected void Buton _Click(object sender, EventArgs e)
{
String xx;
String YY;
String ZZ;
if(txtbox1.text!='''')
{
xx=txtbox1.text;
}
if(txtbox2.text!='') { YY=txtbox2.text; }
if(txtbox3.text!='') { ZZ=txtbox3.text; }
}
这篇关于我在一个按钮单击事件中有三个文本框如何获取asp.net中文本框的任何一个值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文