[Mono-devel-list] How to maintain values in a HtmlSelect when modifying the content with javascript ?

Tiago Lima tiago.lima at vianw.pt
Thu Dec 11 17:59:36 EST 2003


Hi,

I've a question regarding whether an HtmlSelect maintains the "options" inside 
it when these options get modified in javascript. I dont know how 
Microsoft .NET handles this...

I have two HtmlSelects, one of them starts empty and the other one have all 
the elements... The user moves around the elements from one to another and 
then posts the result... I want to know the elements in the first 
HtmlSelect... How do I do this?

If I select one of the elements in the first HtmlSelect then I get an error:

System.IndexOutOfRangeException: Array index is out of range
in [0x00074] (at /home/duncan/Mono/mcs/class/System.Web/
System.Web.UI.HtmlControls/HtmlSelect.cs:209) 
System.Web.UI.HtmlControls.HtmlSelect:System.Web.UI.IPostBackDataHandler.LoadPostData 
(string,System.Collections.Specialized.NameValueCollection)
i
...

this is because the HtmlSelect has no elements in the beggining !

Is the System.Web.UI.WebControls.ListBox controls doing this?

Thanks in advance,
	Tiago Lima




More information about the Mono-devel-list mailing list