如何在asp.net中将文本值添加到多个tex框 [英] how to add text value to multiple tex box in asp.net

查看:57
本文介绍了如何在asp.net中将文本值添加到多个tex框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们添加一些值并单击添加按钮时,我会有一个文本框,然后此值添加多个文本框.

i have a textbox when we put some value and click add button then this value add multiple textbox .

推荐答案

如果我没有记错,那么您想添加您的文本框值将变为其他文本框.如果是这样,那么您就可以:-
在button_Click上编写以下代码:
If i am not wrong then you want to add your textbox value to some ohter textboxes. If It is so then here you go:-
On button_Click write following code:
protected void button_Click(object sender, EventArgs e)
{
   //first retrieve the value of your textbox and store it into string
   string firstvalue = textBox1.Text;
   //then assign this string value to your rest of the textbox or label.
   textBox2.Text = firstvalue;
   textBox3.Text = firstvalue;
   label1.Text = firstvalue;
 }



希望对您有帮助.

祝你好运.



I hope it will help you.

Good luck.


尝试使用此代码


try using this code


protected void button_Click(object sender, EventArgs e)
 {
    
   string multivalue = textBox1.Text.ToString();
  
    textBox2.Text = multivalue;
    textBox3.Text = multivalue;
   
  }


这篇关于如何在asp.net中将文本值添加到多个tex框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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