c# - Selection of dropdown save -


i have 1 dropdownlist,it contains 3 items open invoices,close invoices , invoices.when select 1 should array or arraylist.like if select index 1 means should save,then select index 2 means should save,again select index 1 means shouls save in seperate index of arrat,not replace.is possible array,for foreach or arraylist.i try arraylist

if (ddltransaction.selectedindex < 3) {     list.add(ddltransaction.selecteditem); } 

but save current selection of dropdown item save.

note sure if understand question seems issue not persisting list after postback, try use session in order persist :

list<string> list = new list<string>(); if(session["list"] != null) { list  = (list<string>)session["list"]; } if (ddltransaction.selectedindex < 3) {     list.add(ddltransaction.selectedvalue);     session["list"] = list; } 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -