c# - List<string> Only displaying last item -


trying make list out of string of part names. it's skipping displaying names except last 1 in list.. why doing this? there better way of doing this?

my code behind

    list<string> ta1partnumbers = ta1input.split('\n').tolist<string>(); //trying split @ line break.. proper way it?      foreach (string tpartnumber in trampartnumbers)     {         div1.innertext = (tpartnumber);     } 


list so:
part_numbers
1017foo
1121bar
etc..

you're resetting innertext value each iteration of loop, retains last one. try appending += operator

foreach (string tpartnumber in transimpartnumbers) {     div1.innerhtml += tpartnumber + "<br />"; } 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -