Problem with a ListBox in code behind

  • Thread starter Mart?n Llanos via .NET 247
  • Start date
M

Mart?n Llanos via .NET 247

I've this problem, in my aspx i put a ListBox, when i add lines to this ListBox and and click de button "Guardar", a java script function is called. In that java script I have this code:

var lbPozosToAdd = document.all.lbPozosToAdd;

for(var i = 0; i < ListBox.length; i++){
ListBox.options.selected = true;
}

This work OK, but in the code behind when I try to validate the ListBox Ex: if(ListBox.Items.Count != 0), the count is always 0, why?

Thanks for your help, sorry my English, I'm from Argentina
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top