Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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. :)
Posted
Comments
Raajkumar.b 6-Mar-14 0:32am    
hi,
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;
}
}

if your requirement is not this let me know.
Amirsalgar1 6-Mar-14 4:18am    
Thanx ..sir got it
Sergey Alexandrovich Kryukov 6-Mar-14 0:53am    
No, writing commas are well beyond the capability of programming... :-)
—SA
Anand Gunasekaran 6-Mar-14 1:01am    
You want the output like currency comma placement.(i.e). 1,000 - 10,000 - 1,10,000 .
BillWoodruff 6-Mar-14 5:58am    
What causes a value to be added, and then have a comma added to it ? The user types something ? The user hits Enter/Return ? The user clicks a Button ?

1 solution

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;
        }
    }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900