我希望在文本框中添加值,每当我添加它应该分开的值时,(逗号) [英] I Want Add The Value In Textbox , In Multiple Times Whenever I Add Value It Should Separate By ,(Comma)
本文介绍了我希望在文本框中添加值,每当我添加它应该分开的值时,(逗号)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hii ..
i想在文本框中添加值,多次在我添加值时它应该分开,(逗号)
是否有任何方法可以实现这是
thnks in adv。 :)
hii ..
i want add the value in textbox , in multiple times whenever i add value it should separate by ,(comma)
is there any way to achieve it
thnks in adv. :)
推荐答案
我已经选择了一个文本框,标签和按钮。
当你在文本框中输入文本并每次点击添加按钮输入的文本将以逗号(,)分隔的标签显示
代码:
i have taken one textbox,label,and button.
when you enter text in textbox and click add button every time entered text will display in label separated by comma(,)
code:
protected void Button1_Click(object sender, EventArgs e)
{
if (Session["text"] != null)
{
string s = Session["text"].ToString();
Label1.Text =s + "," + TextBox1.Text;
Session["text"] = Label1.Text;
}
else
{
Label1.Text = TextBox1.Text;
Session["text"] = Label1.Text;
}
}
这篇关于我希望在文本框中添加值,每当我添加它应该分开的值时,(逗号)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文