Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
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 13-Feb-13 1:55am
Comments
ryanb31 at 13-Feb-13 7:56am
   
You can use javascript. What do you have so far?
Jαved at 13-Feb-13 8:03am
   
Not clear, exactly what do you want to do?
Maciej Los at 13-Feb-13 8:04am
   
Is this your homework? If yes, do it yourself!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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..
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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 Smile | :)
  Permalink  

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



Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 13 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100