Click here to Skip to main content
15,896,207 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,


I have a listbox and textbox in asp.net c# language
I need to add the sum of all values in to a listbox using text box , when i enter something it will add list box and again i will do the same flow it will come one by one .

please give me any idea or any code its very urgent.

thanks in advance.
Posted
Comments
ZurdoDev 13-Feb-13 7:56am    
You can use javascript. What do you have so far?
Jαved 13-Feb-13 8:03am    
Not clear, exactly what do you want to do?
Maciej Los 13-Feb-13 8:04am    
Is this your homework? If yes, do it yourself!

It looks a quite elementary task to me. What have you tried so far?
You may code a method for summing up all list box items and another method for adding text box content to the list box..
 
Share this answer
 
Quote:
please give me any idea

You might be using an event to add item(a button perhaps). If yes, use onclick event of the button. In that event create a new listitem(a listbox is a collection of listitems) and use ListBox's Add event to add the new item at the specified position. Give it a try. For a start:
ListBox.Item.Insert(int index, ListItem item);
Quote:
its very urgent

I don't think so :-)
 
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