Thursday, March 29, 2012

List Boxes and Post Back.

Hi!, this is the problem:

I have and .aspx page that has two List Box.
The list box from the left, has a list o registers (agents in my case), and what I should do, is that when I choose one from that list, then I click on a button and the selected item, goes to the other listbox.
I mean, I have to delete that item from the first listbox and add it to the second one.

The thing is, I made some javascript for doing that. In html works perfectly, but, in aspx, not.
The problem is that every time I add an item, the page makes a submit.
I tried to add the AutoPostBack = False in the List Box, but I didn't work.

So, I thought I should use a "normal" List Box... but... how to fill that list box if it is not an ASPX Control ?

What should I do?, is there any other way to do that?

Thanks !The listbox is most likely being binded on each postback.

Try this:

If not page.ispostback then
'Load Listboxes
End If

HTH,

AspDotNetGuy
Illya,

Is this what you're trying to do?

Here's one more.
Yes!, that's what I need.

I'll check that examples.

Thanks !!!

0 comments:

Post a Comment