On Mon, 26 Dec 2005 09:55:56 -0800, math.kiran wrote:
I have a list box which gets populated client side (Javascript).
Now when I submit the page - I need to capture all the list item and
store it in database.
What is the elegant way to do it in asp.net?
Thanks
KM
Use XML to encode the option array
corresponding to the select in a hidden type field. To this effect
you either enumerate the option array, or give all the options the same id
(as in <option id=myoption value=1>one</option>) and enumerate
document.all.myoption.
You should build xml like:
<myoption value=1>
<myoption value=2>
....
Once you receive the object representing the options you can store this in
the database via a stored procedure that accepts the XML as a parameter,
loads the XML into a temporary dom and processes this dom via a select.