I found another way around this. If you hijack the form submit, you can
select all members of the ListBox and then submit the code, this is only any
good if you dont want to select a single item from the list. Otherwise your
hidden field idea is the only way forward.
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
If IsPostBack Then
Dim col As System.Collecti ons.Specialized .NameValueColle ction
Dim listItemsArray( ) As String
Dim strListItems As String
col = Request.Form
strListItems = col.Item("ListB ox1")
listItemsArray = strListItems.Sp lit(",")
ListBox1.Items. Clear()
For Each s As String In listItemsArray
ListBox1.Items. Add(s)
Next
End If
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
No, I think you are right about that part :) i could look into it, but
let's say you are...can't think of how else it would do it ...nice catch!
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Mr Newbie" <he**@now.com > wrote in message
news:eq******** ******@TK2MSFTN GP14.phx.gbl... OK, that makes sense I suppose. Presumably though viewstate is used with
textboxes to determine and fire the text changed event by comparing the
text before and that which is preserved in viewstate, or do I have that
wrong as well.
I dont seem to be doing very well today!
Cheers Mr N
Just to clarify in addition to my post...TextBoxe s don't work like you
think they do with ViewState. The value of a textbox isn't preserved
via ViewState. Since there's only 1 value and HTML specifications say
that the value has to be passed via REquest.Form, it would be foolish
for ASP.Net to also maintain it in ViewState (waste of space).
ViewState is used where/when Request.Form can't. Namely for controls
that don't participate in the form submission (datagrid for example) as
well as controls who only partially participate in form submission (only
the selected radio input gets passed).